Method ToInt64
ToInt64()
Converts value of this instance to 64-bit signed integer.
Declaration
public virtual long ToInt64()
Returns
Type | Description |
---|---|
Int64 | Value of this instance as 64-bit signed integer. |
Remarks
This conversion is valid only for numeric instances such as
IntegerValue, LongValue,
DoubleValue, NumberValue, instances
of TimestampValue or instances
of StringValue containing valid representation of
64-bit signed integer. For TimestampValue, it
returns number of milliseconds since Unix Epoch
(1970-01-01T00:00:00).
Exceptions
Type | Condition |
---|---|
InvalidCastException | If this instance is not numeric and not TimestampValue or StringValue. |
OverflowException | In a checked context, if this instance is numeric and represents value less than MinValue or greater than MaxValue |
FormatException | If this instance is StringValue and it does not contain valid representation of integer. |