DateTime
Date-time values indicate a specific instant in time and can be specified in Deephaven query strings by using single quotes '
.
Syntax
'YYYY-MM-DDThh:mm:ss.ffffff 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 minuteffffff
- the fraction of a secondTZ
- the time zone
Example
The following example creates a table containing date-times and then filters the table based upon a date-time defined in a query string.
from deephaven.time import to_datetime
from deephaven import new_table
from deephaven.column import datetime_col
first_time = to_datetime("2021-07-04T08:00:00 NY")
second_time = to_datetime("2021-09-06T12:30:00 NY")
third_time = to_datetime("2021-12-25T21:15:00 NY")
source = new_table([
datetime_col("DateTimes", [first_time, second_time, third_time])
])
result = source.where(filters=["DateTimes = '2021-09-06T12:30:00 NY'"])
- source
- result