Report a bug
If you spot a problem with this page, click here to create a GitHub issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

mir.ion.timestamp

Ion Timestamp
struct IonTimestamp;
Ion Timestamp

Note The component values in the binary encoding are always in UTC, while components in the text encoding are in the local time! This means that transcoding requires a conversion between UTC and local time.

IonTimestamp precision is up to 10^-12 seconds;

enum Precision: ubyte;
year
month
day
minute
second
fraction
short offset;
The offset denotes the local-offset portion of the timestamp, in minutes difference from UTC.
ushort year;
Year
Precision precision;
ubyte month;
Month
If the value equals to thero then this and all the following members are undefined.
ubyte day;
Day
If the value equals to thero then this and all the following members are undefined.
ubyte hour;
Hour
ubyte minute;
Minute

Note the field is implemented as property.

ubyte second;
Second

Note the field is implemented as property.

byte fractionExponent;

long fractionCoefficient;
Fraction
The fraction_exponent and fraction_coefficient denote the fractional seconds of the timestamp as a decimal value The fractional seconds’ value is coefficient * 10 ^ exponent. It must be greater than or equal to zero and less than 1. A missing coefficient defaults to zero. Fractions whose coefficient is zero and exponent is greater than -1 are ignored.
'fractionCoefficient' allowed values are [0 ... 10^12-1]. 'fractionExponent' allowed values are [-12 ... 0].

Note the fields are implemented as property.

pure nothrow @nogc @safe this(ushort year);
pure nothrow @nogc @safe this(ushort year, ubyte month);
pure nothrow @nogc @safe this(ushort year, ubyte month, ubyte day);
pure nothrow @nogc @safe this(ushort year, ubyte month, ubyte day, ubyte hour, ubyte minute);
pure nothrow @nogc @safe this(ushort year, ubyte month, ubyte day, ubyte hour, ubyte minute, ubyte second);
pure nothrow @nogc @safe this(ushort year, ubyte month, ubyte day, ubyte hour, ubyte minute, ubyte second, byte fractionExponent, ulong fractionCoefficient);
const pure nothrow @nogc @safe IonTimestamp withOffset(short offset);