UnixTime
UnixTime[]
gives the total number of seconds since the beginning of January 1, 1970, in the GMT time zone.
UnixTime[{y,m,d,h,m,s}]
gives the Unix time specification corresponding to a date list.
UnixTime[date]
gives the Unix time specification corresponding to a DateObject.
UnixTime["string"]
gives the Unix time specification corresponding to a date string.
UnixTime[{"string",{"e1","e2",…}}]
takes the date string to contain the elements "ei".
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)
Scope (6)
Inputs are assumed to be in $TimeZone. Block can be used to specify a different input time zone:
DateObject expressions can include their own TimeZone specification:
Separators are assumed if not specified:
Date lists are converted to standard normalized form:
Day, hour, minute, and second values in input date lists can be noninteger:
Properties & Relations (2)
UnixTime converts a date specification into Unix time form:
FromUnixTime converts back into a DateObject expression:
Compute the number of seconds between January 1, 1900, and January 1, 1970:
Text
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.
APA
Wolfram Language. (2015). UnixTime. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/UnixTime.html