FromUnixTime

FromUnixTime[time]

gives a date object corresponding to a UnixTime specification.

Details and Options

Examples

open allclose all

Basic Examples  (2)

Create a DateObject expression from a Unix time specification:

Get the start date for Unix time, expressed in the GMT time zone:

Options  (6)

CalendarType  (1)

By default, dates are generated as Gregorian calendar dates:

Use CalendarType"Julian" to generate an object with the "Julian" calendar:

DateFormat  (2)

Use long date format:

Specify your own format:

DateGranularity  (1)

By default, dates are generated with "Instant" granularity:

Use DateGranularity"Day" to generate a day granular date:

TimeSystem  (1)

Specify the output TimeSystem for the DateObject:

TimeZone  (1)

Specify the time zone for the output DateObject expression:

Properties & Relations  (2)

FromUnixTime converts from Unix time into a DateObject expression:

UnixTime converts back into Unix time form:

If Unix time was stored in a signed 32-bit integer, then it would cover a period of about 136 years:

FromUnixTime can work with much larger integers:

Possible Issues  (1)

By default, FromUnixTime returns results in your $TimeZone:

For a historical value of a time stamp in a given location at a given time, LocalTime can be used:

Wolfram Research (2015), FromUnixTime, Wolfram Language function, https://reference.wolfram.com/language/ref/FromUnixTime.html (updated 2023).

Text

Wolfram Research (2015), FromUnixTime, Wolfram Language function, https://reference.wolfram.com/language/ref/FromUnixTime.html (updated 2023).

CMS

Wolfram Language. 2015. "FromUnixTime." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/FromUnixTime.html.

APA

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

BibTeX

@misc{reference.wolfram_2024_fromunixtime, author="Wolfram Research", title="{FromUnixTime}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/FromUnixTime.html}", note=[Accessed: 06-October-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_fromunixtime, organization={Wolfram Research}, title={FromUnixTime}, year={2023}, url={https://reference.wolfram.com/language/ref/FromUnixTime.html}, note=[Accessed: 06-October-2024 ]}