Reply | Reply to all | Forward | Print | Delete | Show original
Don't use TimeStamp. I see several issues which break your snippet:
1) #printOn: and #storeOn: ignore time zone information (offset).
2) Class side #readFrom: ignores time zone information (offset).
3) Class side #readFrom: can not fully parse the output of #storeOn:. It seems to only work by accident.
4) It's a subclass of DateAndTime, but it seems to add noting generally useful. Based on the class comment, it has the same purpose as DateAndTime, but that's not the case.
So, use DateAndTime instead:
t1 := DateAndTime now.
s := String streamContents: [:stream | t1 storeOn: stream ].
t2 := Compiler evaluate: s.
{ t1 offset. t2 offset. t1 = t2 } "==> {0:02:00:00 . 0:02:00:00 . true}"
Levente