Class Timestamp
- Namespace
- GenerativeAI.Types
- Assembly
- GenerativeAI.dll
A Timestamp represents a point in time independent of any time zone or calendar, represented as seconds and fractions of seconds at nanosecond resolution in UTC Epoch time.
[JsonConverter(typeof(TimestampJsonConverter))]
public class Timestamp
- Inheritance
-
Timestamp
- Inherited Members
- Extension Methods
Properties
Nanos
Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive.
public int Nanos { get; set; }
Property Value
Seconds
Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.
public long Seconds { get; set; }
Property Value
Methods
FromDateTime(DateTime)
public static Timestamp FromDateTime(DateTime dateTime)
Parameters
Returns
ToDateTime()
public DateTime ToDateTime()
Returns
Operators
implicit operator DateTime(Timestamp)
public static implicit operator DateTime(Timestamp timestamp)
Parameters
Returns
implicit operator Timestamp(DateTime)
public static implicit operator Timestamp(DateTime dateTime)