Version 7 of clock seconds

Updated 2004-12-10 13:54:02

Returns the number of seconds since January 1st, 1970. Also known as "Unix time", "timestamp" or "epoch".

Example:

 clock seconds

on Dec 10 2004, 11:44:22, returns

 1102686262

See also: clock


LV Is the epoch the same on all platforms and operating systems?

MSW Due to the source, at least under unix and windows the epoch is 1970-01-01 @ midnight. Under mac the epoch starts (due to the comments) Midnight Jan 1, 1904. mac/tclMacTime.c adds another tcl_mac_epoch_offset which is initialized by _mac_msl_epoch_offset_ if defined (and 0 otherwise), which I assume brings the Mac epoch in sync with the unix epoch. (I don't have a Mac handy to test...)


Category Command Category Date and Time