date-time
A date-time value indicates a specific instance in time. In Deephaven, a date-time is typically represented by one of two data types:
These data types are used by Deephaven tables to represent moments in time. They are also used in the Python API. Both will be covered in this reference guide.
Instant
A java.time.Instant represents a single instantaneous point in time, given in the UTC time zone. Printing an instance of an instant always ends in the letter Z, which is shorthand for UTC.
ZonedDateTime
A java.time.ZonedDateTime represents a single instantaneous point in time, given in the specified time zone. Printing an instance of a zoned date-time always ends in the specified time zone. For instance, for the ET (US Eastern Time) time zone, a ZonedDateTime ends in [America/New_York].
Syntax
'YYYY-MM-DDThh:mm:ss.ddddddddd TZ'
YYYY- the yearMM- the monthDD- the dayT- the separator between the date and timehh- the hour of the daymm- the minute of the hourss- the second of the minuteddddddddd- the fraction of a secondTZ- the time zone
Example
The following example uses to_j_instant and to_j_zdt to convert two dates into Instants and ZonedDateTimes. The results are then printed.