date_diff.asciidoc 804 B

123456789101112131415161718192021222324252627
  1. // This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
  2. *Description*
  3. Subtracts the `startTimestamp` from the `endTimestamp` and returns the difference in multiples of `unit`. If `startTimestamp` is later than the `endTimestamp`, negative values are returned.
  4. [cols="^,^",role="styled"]
  5. |===
  6. 2+h|Datetime difference units
  7. s|unit
  8. s|abbreviations
  9. | year | years, yy, yyyy
  10. | quarter | quarters, qq, q
  11. | month | months, mm, m
  12. | dayofyear | dy, y
  13. | day | days, dd, d
  14. | week | weeks, wk, ww
  15. | weekday | weekdays, dw
  16. | hour | hours, hh
  17. | minute | minutes, mi, n
  18. | second | seconds, ss, s
  19. | millisecond | milliseconds, ms
  20. | microsecond | microseconds, mcs
  21. | nanosecond | nanoseconds, ns
  22. |===