Class TimestampValue
Inherited Members
Namespace: Oracle.NoSQL.SDK
Assembly: Oracle.NoSQL.SDK.dll
Syntax
public class TimestampValue : FieldValue
Remarks
This class is used to represent values of NoSQL data type Timestamp. This value is represented by a C# type DateTime indicating an instance of time in UTC. Instances of TimestampValue always represent their value in UTC.
The values of this instance can also be converted to long
representing number of milliseconds since Unix Epoch,
1970-01-01 00:00:00 UTC. Reverse conversion is also supported (see
ToDateTime()).
In JSON, the instances of this class may be represented as either String or Number depending on the value of DateTimeAsMillis. If represented as String, the format is given by DateTimeFormatString. The default format is ISO8601 in UTC given by DefaultDateTimeFormatString. If represented as Number, the value is the number of milliseconds since the Unix Epoch.
Constructors
Name | Description |
---|---|
TimestampValue(DateTime) | Initializes a new instance of TimestampValue with the specified DateTime value. |
TimestampValue(Int64) | Initializes a new instance of TimestampValue with the specified number of milliseconds since the Unix Epoch. |
TimestampValue(String) | Initializes a new instance of TimestampValue with the specified date and time string. |
Properties
Name | Description |
---|---|
AsDateTime | Gets the value of this instance as date and time. |
DbType | Gets DbType of this instance which represents the type of this value. |
Methods
Name | Description |
---|---|
SerializeAsJson(Utf8JsonWriter, JsonOutputOptions) | Writes JSON representation of the value to the stream represented by Utf8JsonWriter. |
ToInt64() | Converts the value represented by this instance to a 64-bit sighed integer representing the number of milliseconds since the Unix Epoch. |