AbsoluteTime

AbsoluteTime[]

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

AbsoluteTime[date]

gives the absolute time specification corresponding to the given date specification.

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.
  • In AbsoluteTime[date], the following date and time specifications can be given as date:
  • dateDateObject specification
    {y,m,d,h,m,s}DateList specification
    timeAbsoluteTime specification
    "string"DateString specification
    {"string",fmt}date string formed from the specified format
  • 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:

Applications  (1)

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

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:

The number of seconds returned by AbsoluteTime corresponds to the "AbsoluteTime" calendar:

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 BCE, to the beginning of January 1, 1900:

That proleptic Gregorian date is noon on January 1, 4713 BCE in the Julian calendar:

Wolfram Research (1991), AbsoluteTime, Wolfram Language function, https://reference.wolfram.com/language/ref/AbsoluteTime.html (updated 2014).

Text

Wolfram Research (1991), AbsoluteTime, Wolfram Language function, https://reference.wolfram.com/language/ref/AbsoluteTime.html (updated 2014).

CMS

Wolfram Language. 1991. "AbsoluteTime." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/AbsoluteTime.html.

APA

Wolfram Language. (1991). AbsoluteTime. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AbsoluteTime.html

BibTeX

@misc{reference.wolfram_2024_absolutetime, author="Wolfram Research", title="{AbsoluteTime}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/AbsoluteTime.html}", note=[Accessed: 11-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_absolutetime, organization={Wolfram Research}, title={AbsoluteTime}, year={2014}, url={https://reference.wolfram.com/language/ref/AbsoluteTime.html}, note=[Accessed: 11-November-2024 ]}