Arc Forumnew | comments | leaders | submitlogin
Strange quirk with 'date' I only noticed today
1 point by thaddeus 5808 days ago | 5 comments

  arc> (date)
  (2009 6 23)

  arc> (system "date")
  Tue 23 Jun 2009 00:15:00 GMT

  thad-systems-imac-g5:~ Thad$ date
  Mon 22 Jun 2009 18:17:11 MDT
probably just a cache problem with my machine ?

anyone else run into this ?

Thanks, T.



3 points by CatDancer 5808 days ago | link

In arc3 ac.scm has

  (putenv "TZ" ":GMT")

-----

1 point by thaddeus 5808 days ago | link

So I changed it to: (putenv "TZ" ":MDT")

now I get....

  arc>(system "date")
  Tue 23 Jun 2009 00:57:10 UTC

-----

1 point by CatDancer 5808 days ago | link

If you're going to set TZ, you need to set it to a valid TZ value, or else date is going to default to UTC.

http://www.gnu.org/s/libc/manual/html_node/TZ-Variable.html

But if you want it to use your normal system timezone, just don't set TZ.

-----

1 point by thaddeus 5808 days ago | link

ah - i just commented out the whole thing and it's fixed.

Thanks for pointing me in the right direction.

-----

1 point by thaddeus 5808 days ago | link

this is interesting.... when I try the same thing in arc2...

   arc> (system "date")
   Mon 22 Jun 2009 18:35:56 MDT
Thinking it's a bug in mzscheme 372 ?

T.

-----