Import std.time.timestamp
std.time.timestamp
Timestamp: a point in time, in UTC, to the nanosecond, from the year -999999999 to 999999999, as the real clock and Unix times give one. Its zero is 1970-01-01T00:00:00Z. A zone's clocks show it as a ZonedDateTime (in zone.fb). ToString and Parse write and read RFC 3339, ISO 8601's form for one, like "2026-10-23T12:30:00Z".
std/time/timestamp.fb
Types
Timestamp
struct
Public Struct Timestamp Implements Comparable, Hashable, Printable, Defaultable
A moment in time, as UTC counts it: its seconds since 1970-01-01T00:00:00Z, and the nanoseconds after them.
std/time/timestamp.fb, line 18
-
Now, on the real clock, which the OS can set back or on.
-
The value to start from, like 0 for a number, "" for a String, or an empty collection.
-
1970-01-01T00:00:00Z, where Unix time starts.
-
The earliest Timestamp there is.
-
The latest Timestamp there is.
-
@PanicsAtCaller Public Static Method FromUnixSeconds(seconds: Int64, nanoseconds: Int64 = 0): Timestampstatic method #The Timestamp that many
seconds, andnanoseconds, after 1970-01-01T00:00:00Z, or before it below 0, as Unix time counts them, without leapseconds. One past the years a Timestamp holds panics. -
The Timestamp that many
millisecondsafter 1970-01-01T00:00:00Z, or before it below 0. -
The Timestamp that many
nanosecondsafter 1970-01-01T00:00:00Z, or before it below 0. -
The Timestamp RFC 3339 writes, like "2026-10-23T12:30:00Z" or "2026-10-23T14:30:00.5+02:00", with "T", "t", or a space before the time, or Null.
-
@PanicsAtCaller Public Static Method Parse(text: String, pattern: String): Timestamp?static method #The Timestamp the
textwrites as thepatternsays (see format.fb), or Null. A pattern without the date, or without an offset or a zone, panics. -
Its seconds since 1970-01-01T00:00:00Z, rounded down, so a moment before it has the second before.
-
Its milliseconds and nanoseconds since 1970-01-01T00:00:00Z, rounded down. Those past what an Int64 holds, from before 1677 or after 2262 for nanoseconds, panic.
-
Its nanoseconds since 1970-01-01T00:00:00Z. Panics when they're past what an Int64 holds.
-
Its nanoseconds past the second, from 0 to 999999999.
-
It where the
zoneis. -
Its date and time in UTC.
-
baftera. One past the years a Timestamp holds panics. -
bbeforea. One past the years a Timestamp holds panics. -
How long it is from
btoa, below 0 whenais earlier, which panics past the longest Duration, about 292 years. -
Whether
acomes beforeb.Doc from
std.core.interfaces.Comparable.Operator<. -
As RFC 3339 writes it in UTC, with a fraction only when there is one, like "2026-10-23T12:30:00Z" and "2026-10-23T12:30:00.25Z".
-
As RFC 2822 writes it, in UTC: "Fri, 23 Oct 2026 12:30:00 +0000".
-
As the
patternsays (see format.fb), in UTC.
Report an issue with this page or with FutureBlitz on GitHub.