Constructor TimestampValue
TimestampValue(DateTime)
Initializes a new instance of TimestampValue
with the specified DateTime value.
Declaration
public TimestampValue(DateTime value)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | value | A date and time value which this instance will represent. |
Remarks
The date and time value represented by this instance is obtained
by converting the provided
value to UTC by
ToUniversalTime() (no conversion is performed
if the System.DateTime.Kind of value is
Utc.
See Also
TimestampValue(Int64)
Initializes a new instance of TimestampValue with
the specified number of milliseconds since the Unix Epoch.
Declaration
public TimestampValue(long value)
Parameters
| Type | Name | Description |
|---|---|---|
| Int64 | value | The number of milliseconds since the Unix Epoch. |
Remarks
This method performs the same conversion as
ToDateTime(). The resulting
DateTime value is always in UTC.
Exceptions
| Type | Condition |
|---|---|
| OverflowException | If value
milliseconds produces a TimeSpan value less than
MinValue or greater than
MaxValue.
|
| ArgumentOutOfRangeException | If the resulting DateTime value is less than MinValue or greater than MaxValue |
See Also
TimestampValue(String)
Initializes a new instance of TimestampValue with
the specified date and time string.
Declaration
public TimestampValue(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| String | value | A date and time string from which to initialize this instance. |
Remarks
This method performs the same conversion as
ToDateTime(String) and then converts the
resulting DateTime to UTC using
ToUniversalTime().
Exceptions
| Type | Condition |
|---|---|
| FormatException | The value is
not a valid date and time string.
|