Calculate the interval between two dates or timestamps.
The default d type returns the number of whole days. The text type
returns an English duration using days, hours, minutes, and seconds while
omitting zero-valued units. A zero interval returns "0 seconds". Any other
type returns the number of whole seconds. Negative intervals and invalid
dates return an empty string.
Formatting options. Use d for whole days or text for an English duration.
Returns string|number
Whole days, whole seconds, an English duration, or an empty string for a negative or invalid interval.
Remarks
Strings in YYYY-MM-DD HH:mm:ss format are normalized and parsed as local time. Other date strings use the runtime's native Date parser; use timestamps or ISO strings with an explicit timezone when parsing must be portable.
Calculate the interval between two dates or timestamps.
The default
dtype returns the number of whole days. Thetexttype returns an English duration using days, hours, minutes, and seconds while omitting zero-valued units. A zero interval returns"0 seconds". Any other type returns the number of whole seconds. Negative intervals and invalid dates return an empty string.Usage:
Output: