Time operations cheat sheet

Formats

hh:mm:ss

Deephaven time tables use timestamps in the "PTH##M##S##N## format to specify ticking intervals.

yyyy-mm-ddT:hh:mm:ss.[millis|micros|nanos] TZ

Deephaven time tables may also use the yyyy-mm-ddT:hh:mm:ss.[millis|micros|nanos] TZ format to specify a start date.

TZ represents the time zone. A few examples are:

  • UTC
  • ET (New York)
  • JP (Tokyo)

Date-time constants

Deephaven comes with some predefined constants:

  • DAY
  • HOUR
  • MINUTE
  • SECOND
  • WEEK
  • YEAR

These constants all show the time in nanoseconds.

See the Javadoc for further details.

Convert string to Deephaven date-time object

Deephaven supports converting a string to a Deephaven date-time object via the [parseInstant] method.

Strings should be in the yyyy-mm-ddT:hh:mm:ss.[millis|micros|nanos] TZ format.

Convert nanoseconds to Deephaven date-time object

Deephaven supports converting a long representing nanoseconds since the Epoch to a Deephaven date-time object via the [autoEpochToInstant] method.

Date-time columns

Deephaven tables have built-in support for Deephaven date-time objects via the instantCol method.

Timestamp comparison

Deephaven's filtering has support for timestamp comparisons.

Note

Query strings require single quotes ' around timestamps.

See our How to use filters guide for more information.

Time zones

Downsampling temporal data via time binning

Downsampling time series data may be accomplished by calculating binning-intervals for time values and using appropriate aggregation methods, grouped by the binned interval.