"UnixTime" (Interpreter Type)
Unix time specification in terms of number of seconds that have elapsed since January 1, 1970, 00:00:00 Coordinated Universal Time (UTC), not counting leap seconds.
Details
- "UnixTime" can be used in Interpreter and related constructs, including deployed smart form fields.
- Use of "UnixTime" does not require connectivity to the Wolfram Cloud.
Restriction Specifications
-
Restricted["UnixTime",{{choices1,…}}] one among choices Restricted["UnixTime",max] a Unix time before max Restricted["UnixTime",{min,max}] a Unix time between min and max Restricted["UnixTime",{min,max,unit}] a Unix time between min and max, with resolution unit
Options
- The following options can be used:
-
DigitBlock Infinity number of digits between breaks NumberSeparator {","," "} string to insert at breaks between blocks NumberSigns {"-",""} strings to use for signs of negative and positive numbers
Interpretation
- "UnixTime" yields a DateObject with a TimeObject at its second argument.
Examples
Basic Examples (3)
Interpreter["UnixTime"]["1429297335"]Interpreter["UnixTime"]["1577836800"]Use negative integers for times before January 1, 1970, 00:00:00 UTC:
Interpreter["UnixTime"]["-123456789"]Restrict the value to be within a given range:
Interpreter[Restricted["UnixTime", {DateObject[{1970, 1, 1}], DateObject[{1980, 1, 1}]}]]["2.3e9"]Use a custom number separator:
Interpreter["UnixTime", NumberSeparator -> "."]["1.577.836.800"]Interpreter[Restricted["UnixTime", {-Infinity, Now, "Minute"}]]["120"]Interpreter[Restricted["UnixTime", {-Infinity, Now, "Minute"}]]["155"]See Also
Interpreter Restricted Failure FromUnixTime
Interpreter Types: Time Date DateTime DayOfWeek ExcelDate StructuredTime ComputedTime StructuredDate ComputedDate StructuredDateTime ComputedDateTime
Related Guides
History
Introduced in 2015 (10.2)