<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 2, 2018 at 8:59 AM, Levente Uzonyi <span dir="ltr"><<a href="mailto:leves@caesar.elte.hu" target="_blank">leves@caesar.elte.hu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Don't use TimeStamp. I see several issues which break your snippet:<br>
1) #printOn: and #storeOn: ignore time zone information (offset).<br>
2) Class side #readFrom: ignores time zone information (offset).<br>
3) Class side #readFrom: can not fully parse the output of #storeOn:. It seems to only work by accident.<br>
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.<br>
<br></blockquote><div>Seconded - don't use TimeStamp.  It did exist before DateAndTime, then was moved to a subclass to ease porting. </div><div>Besides the reasons Levente gave, a few external packages (on SqueakMap/SqueakSource) contain TimeStamp extensions and/or redefinition that really, really mess up with the current definition.  If you get unlucky enough to load one of these and you are using TimeStamp, things stop working (or mostly work while corrupting your data).</div><div><br></div><div>-cbc</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So, use DateAndTime instead:<br>
<br>
| t1 t2 s |<br>
t1 := DateAndTime now.<span class=""><br>
s := String streamContents: [:stream | t1 storeOn: stream ].<br></span>
t2 := Compiler evaluate: s.<br>
{ t1 offset. t2 offset. t1 = t2 } "==> {0:02:00:00 . 0:02:00:00 . true}"<span class="HOEnZb"><font color="#888888"><br>
<br>
Levente</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
On Mon, 2 Apr 2018, Tim Johnson wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<br>
I noticed the following:<br>
<br>
| t1 t2 s | <br>
t1 := TimeStamp now.<br>
s := String streamContents: [:stream | t1 storeOn: stream ].<br>
t2 := TimeStamp readFrom: s readStream.<br>
{ t1 offset.  t2 offset.  t1 = t2 } printIt ->  {-0:07:00:00 . 0:00:00:00 . false}<br>
<br>
A web search turned up this thread from 2017:<br>
<br>
<a href="http://forum.world.st/DateAndTime-offset-just-bit-me-td4938463.html" rel="noreferrer" target="_blank">http://forum.world.st/DateAndT<wbr>ime-offset-just-bit-me-<wbr>td4938463.html</a><br>
<br>
I’m wondering if there has been any resolution or if the situation is the same:  I should try the fixes from UTCDateAndTime.<br>
<br>
Happy to write a test if this is worth the effort.<br>
<br>
Thanks,<br>
Tim<br>
<br>
<br>
<br>
</blockquote>
</div></div><br><br>
<br></blockquote></div><br></div></div>