UnixTime
✖
UnixTime
gives the total number of seconds since the beginning of January 1, 1970, in the GMT time zone.
Details

- UnixTime[] returns the number of seconds that have elapsed since {1970, 1, 1, 0, 0, 0.} Greenwich Mean Time (GMT), not counting leap seconds.
- UnixTime[time] assumes that the given time is in $TimeZone, unless it is a DateObject or TimeObject with an explicit TimeZone option value.
- UnixTime[] returns the nearest whole second, down to a granularity of $TimeUnit seconds.
- Shorter lists can be used in UnixTime[{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.
Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Unix time in seconds since January 1, 1970:

https://wolfram.com/xid/0tz8cg2a-xcyvc

Convert from a date object to Unix time:

https://wolfram.com/xid/0tz8cg2a-194928


https://wolfram.com/xid/0tz8cg2a-pa472a

Convert from a date string to Unix time:

https://wolfram.com/xid/0tz8cg2a-d9a7n8


https://wolfram.com/xid/0tz8cg2a-e4vrff

Scope (6)Survey of the scope of standard use cases
Inputs are assumed to be in $TimeZone. Block can be used to specify a different input time zone:

https://wolfram.com/xid/0tz8cg2a-0egeng


https://wolfram.com/xid/0tz8cg2a-4tft9p


https://wolfram.com/xid/0tz8cg2a-p2038

DateObject expressions can include their own TimeZone specification:

https://wolfram.com/xid/0tz8cg2a-9nwv4v


https://wolfram.com/xid/0tz8cg2a-2ucfn5

Separators are assumed if not specified:

https://wolfram.com/xid/0tz8cg2a-c2j9fo


https://wolfram.com/xid/0tz8cg2a-goqhop

Date lists are converted to standard normalized form:

https://wolfram.com/xid/0tz8cg2a-beccom


https://wolfram.com/xid/0tz8cg2a-i0m90

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

https://wolfram.com/xid/0tz8cg2a-mpvi5s


https://wolfram.com/xid/0tz8cg2a-kqxw4m

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

https://wolfram.com/xid/0tz8cg2a-hv4zf

Properties & Relations (2)Properties of the function, and connections to other functions
UnixTime converts a date specification into Unix time form:

https://wolfram.com/xid/0tz8cg2a-w3zjj3

FromUnixTime converts back into a DateObject expression:

https://wolfram.com/xid/0tz8cg2a-r1gtm0

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

https://wolfram.com/xid/0tz8cg2a-fpi6ke

Wolfram Research (2015), UnixTime, Wolfram Language function, https://reference.wolfram.com/language/ref/UnixTime.html.
Text
Wolfram Research (2015), UnixTime, Wolfram Language function, https://reference.wolfram.com/language/ref/UnixTime.html.
Wolfram Research (2015), UnixTime, Wolfram Language function, https://reference.wolfram.com/language/ref/UnixTime.html.
CMS
Wolfram Language. 2015. "UnixTime." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/UnixTime.html.
Wolfram Language. 2015. "UnixTime." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/UnixTime.html.
APA
Wolfram Language. (2015). UnixTime. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/UnixTime.html
Wolfram Language. (2015). UnixTime. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/UnixTime.html
BibTeX
@misc{reference.wolfram_2025_unixtime, author="Wolfram Research", title="{UnixTime}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/UnixTime.html}", note=[Accessed: 26-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_unixtime, organization={Wolfram Research}, title={UnixTime}, year={2015}, url={https://reference.wolfram.com/language/ref/UnixTime.html}, note=[Accessed: 26-March-2025
]}