QueryTemporal

annotation class QueryTemporal(val unit: TimeUnit = TimeUnit.MILLISECONDS, val pattern: String = "")

Declares how a field encodes time when its type does not say so, so time conditions and date histograms can use it. Standard time types (Instant, LocalDate, OffsetDateTime, …) need no annotation.

  • An integer field holds an epoch timestamp in unit: @field:QueryTemporal(unit = TimeUnit.SECONDS).

  • A string field holds a formatted time: @field:QueryTemporal(pattern = "yyyy-MM-dd HH:mm:ss"); unit then keeps its default.

Properties

Link copied to clipboard

A java.time.format.DateTimeFormatter pattern; empty, the default, declares an epoch timestamp.

Link copied to clipboard