AbsoluteTime

AbsoluteTime[]
gives the total number of seconds since the beginning of January 1, 1900, in your time zone.

AbsoluteTime[{y,m,d,h,m,s}]
gives the absolute time specification corresponding to a date list.

AbsoluteTime["string"]
gives the absolute time specification corresponding to a date string.

AbsoluteTime[{"string",{"e1","e2",}}]
takes the date string to contain the elements .

Details and OptionsDetails and Options

  • AbsoluteTime[] uses whatever date and time have been set on your computer system. It performs no corrections for time zones, daylight saving time, etc.
  • AbsoluteTime[TimeZone -> z] gives the date and time inferred for time zone z by assuming that your computer is set for the time zone specified by $TimeZone. »
  • AbsoluteTime[] is always accurate down to a granularity of $TimeUnit seconds, but on many systems is much more accurate.
  • Shorter lists can be used in AbsoluteTime[{y,m,}]: {y} is equivalent to , to , etc.
  • Values of m, d, h, m, s outside their normal ranges are appropriately reduced. Noninteger values of d, h, m, s can also be used. »

ExamplesExamplesopen allclose all

Basic Examples  (4)Basic Examples  (4)

Absolute time in seconds since January 1, 1900:

In[1]:=
Click for copyable input
Out[1]=

Convert a date list or elided date list:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Convert from a date string to absolute time:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Specify date elements for interpreting a string:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 1991
(2.0)
| Updated in 2007
(6.0)