Date/Time Functions

Date / Time Functions

Name Description
date Interpret a String (in "quotations") as a date.
now The current date and time.
today The current date.
reldate A relative date, specified using a String in "quotations" or a number in days.

Examples:

  • reldate("-30d") : subtract 30 days
  • reldate("1m") : add 1 month
  • reldate("1d", today()) : 1 day after today
  • reldate(4) : 4 days
interval Returns the difference between dates in a time series, using the supplied period (default is "1d"). Examples: interval(ts) or interval(ts, "1m"). Returns a time series of numbers, whose first value is 1.
nodst Remove daylight savings time (DST) from dates to treat them with equal weight. Works on a date or time series.
year Return the year of a date
month Return the month of a date
day Return the day of the month from a date
hour Return the hour of a date, as 0 to 23 (24 hour clock)
minute Return the minute of a date
second Return the second of a date
millisecond Return the millisecond of a date
weekday Return the day of the week, from 1 to 7
weeknum Return the week in the year
days360 Return the number of days between two dates based on a 360-day year (12 months of 30 days each). Used for interest calculations. days360(date1, date2) or days360(date1, date2, true/false)
networkdays Returns the number of business days between two dates, inclusive.
workday Returns the date a certain number of working days after a particular date.