[Pythonmac-SIG] Apple Events
Corran Webster
cwebster@nevada.edu
Fri, 14 Apr 2000 16:14:06 -0700
> >
> > import struct, time
> > a, b = struct.unpack('lL', '\000\000\000\000\265\034\246\343')
> > secs = long(a) << 32 + b
Arg! Missing parentheses:
secs = (long(a) << 32) + b
> > print time.ctime(secs), time.asctime(time.gmtime(secs))
> >
> > With this string I get the values 'Mon Apr 15 10:43:47 1996' and 'Mon Apr
> > 15 17:43:47 1996' respectively.
> >
> > You can use something like this in reverse to pack times into an Apple
> > Event, too, I would guess.
> >
> >
> > Regards,
> > Corran
>
> Interesting. When I add
>
> if t == typeLongDate:
> a, b = struct.unpack('lL', desc.data)
> return long(a) << 32 + b
return (long(a) << 32) + b
should work.
>
> to aepack.py, it gives me one of these:
>
> OverflowError: long int too long to convert
>
> So ... ?
My stupidity ;)
Regards,
Corran