[squeak-dev] Unix Time

David T. Lewis lewis at mail.msen.com
Fri Jan 15 06:11:20 UTC 2010


On Thu, Jan 14, 2010 at 09:26:34PM -0700, Mike Hales wrote:
> Is there any protocol in the DateAndTime hierarchy that returns the unix
> time? I want the equivalent of typing "date +%s" on the command line.

No, Squeak inherently uses local time with naive time zone representation.

If you are looking for seconds since the posix epoch, then see:
  http://www.squeaksource.com/TimeZoneDatabase/
  http://wiki.squeak.org/squeak/1076

Then set your time zone and use "PointInTime now asPosixSeconds"
or "DateAndTime now asPointInTime asPosixSeconds".

Dave




More information about the Squeak-dev mailing list