WOLFRAM

FromUnixTime[time]

gives a date object corresponding to a UnixTime specification.

Details and Options

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

Create a DateObject expression from a Unix time specification:

Out[1]=1

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

Out[1]=1

Options  (6)Common values & functionality for each option

CalendarType  (1)

By default, dates are generated as Gregorian calendar dates:

Out[1]=1

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

Out[2]=2

DateFormat  (2)

Use long date format:

Out[1]=1

Specify your own format:

Out[1]=1
Out[2]=2

DateGranularity  (1)

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

Out[4]=4

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

Out[6]=6

TimeSystem  (1)

Specify the output TimeSystem for the DateObject:

Out[3]=3

TimeZone  (1)

Specify the time zone for the output DateObject expression:

Out[1]=1

Properties & Relations  (2)Properties of the function, and connections to other functions

FromUnixTime converts from Unix time into a DateObject expression:

Out[1]=1

UnixTime converts back into Unix time form:

Out[2]=2

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

Out[1]=1
Out[2]=2

FromUnixTime can work with much larger integers:

Out[3]=3

Possible Issues  (1)Common pitfalls and unexpected behavior

By default, FromUnixTime returns results in your $TimeZone:

Out[1]=1

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

Out[2]=2
Wolfram Research (2015), FromUnixTime, Wolfram Language function, https://reference.wolfram.com/language/ref/FromUnixTime.html (updated 2023).
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).

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.

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

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: 10-January-2025 ]}

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

BibLaTeX

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

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