Wiki source for ioSeconds

Show raw source

======**sqInt ioSeconds(void)**======

**Parms**: NONE
**return**: seconds
**From**: Interpreter
return number of seconds since January 1, 1901 as an integer

sqInt primitiveSecondsClock(void)

Uses unix code


uses unix code

int ioSeconds(void) {
time_t unixTime;

unixTime = time(0);
unixTime += localtime(&unixTime)->tm_gmtoff;
/* Squeak epoch is Jan 1, 1901. Unix epoch is Jan 1, 1970: 17 leap years
and 52 non-leap years later than Squeak. */
return unixTime + ((52*365UL + 17*366UL) * 24*60*60UL);

GetLocalTime(&sysTime), then convert to squeak epoch

And when do 32bits overflow?

Valid XHTML :: Valid CSS: :: Powered by WikkaWiki