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[date]

gives the absolute time specification corresponding to a DateObject.

AbsoluteTime["string"]

gives the absolute time specification corresponding to a date string.

AbsoluteTime[{"string",{"e1","e2",}}]

takes the date string to contain the elements "ei".

Details 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 {y,1,1,0,0,0}, {y,m} to {y,m,1,0,0,0}, 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. »
  • The number of seconds returned by AbsoluteTime does not take into account leap seconds.

Examples

open allclose all

Basic Examples  (5)

Absolute time in seconds since January 1, 1900:

Convert from a date object to an absolute time:

Convert a date list or elided date list:

Convert from a date string to absolute time:

Specify date elements for interpreting a string:

Scope  (5)

Strings are automatically interpreted when possible:

Separators are assumed if not specified:

Give explicit separators:

Date lists are converted to standard normalized form:

Day, hour, minute, and second values in input date lists can be noninteger:

The current year is used if not specified in a string:

Generalizations & Extensions  (1)

Give explicit date elements to interpret ambiguous strings:

Options  (1)

TimeZone  (1)

Find the current absolute time in Greenwich, United Kingdom:

Find the absolute time for a given date using a time zone string:

Properties & Relations  (5)

Compute the number of seconds between January 1, 1900, and January 1, 2000:

AbsoluteTime represents dates as seconds since the beginning of 1900:

DateObject represents a given date:

DateList represents dates as lists of date elements:

DateString represents dates as strings:

Use DateListPlot to plot data with absolute time coordinates on a time scale:

UnixTime returns the number of seconds since the beginning of 1970, in the GMT time zone:

Therefore this difference is constant:

It is the number of seconds since January 1, 1900, to January 1, 1970:

JulianDate returns the number of days since noon on November 24, 4714 BCE in the GMT time zone:

Therefore this difference is constant:

It is the number of seconds since noon on November 24, 4714, to the beginning of January 1, 1900:

Introduced in 1991
 (2.0)
 |
Updated in 2003
 (5.0)
2007
 (6.0)
2014
 (10.0)