Chronos is one of the many Smalltalk-related blogs syndicated on Planet Smalltalk
χρόνος

Discussion of the Essence# programming language, and related issues and technologies.

Blog Timezone: America/Los_Angeles [Winter: -0800 hhmm | Summer: -0700 hhmm] 
Your local time:  

2006-08-20

128000000000000000

Microsoft NT counts time as the number of 100-nanosecond ticks since 1601-01-01T00:00:00Z (1 January 1601 00:00:00 Universal Time.) I just happened to notice that the NT clock struck 128000000000000000 a few days ago, specifically at 2006-08-14T03:33:20+00:00 (14 August 2006 03:33:20 Universal Time.)

You can easily compute that using the following Chronos code:


ChronosFunction
daysAndSecondsSinceStartOfDayFromSeconds: 128000000000000000 // 10000000
into: [:days :seconds |
Timepoint
daysSinceEpoch: days + (YearMonthDay year: 1601 day: 1) daysSinceEpoch
seconds: seconds
timeZone: #UT]


If you'd prefer to have the result computed relative to your local time zone, use the following variation:


ChronosFunction
daysAndSecondsSinceStartOfDayFromSeconds: 128000000000000000 // 10000000
into: [:days :seconds |
Timepoint
utDaysSinceEpoch: days + (YearMonthDay year: 1601 day: 1) daysSinceEpoch
seconds: seconds]


No comments: