Working with Dates

Date Formatting

The format used is a restricted form of the canonical representation of dateTime in the XML Schema specification (ISO 8601):


  • YYYY is the year.
  • MM is the month.
  • DD is the day of the month.
  • T is a literal 'T' character that indicates the beginning of the time string.
  • hh is the hour of the day as on a 24-hour clock.
  • mm is minutes.
  • ss is seconds.
  • Z is a literal 'Z' character indicating that this string representation of the date is in UTC

Note that no time zone can be specified; the String representations of dates is always expressed in Coordinated Universal Time (UTC). Here is an example value:


You can optionally include fractional seconds if you wish, although any precision beyond milliseconds will be ignored. Here are examples value with sub-seconds include:

  • 2016-03-27T13:47:26.822Z
  • 2016-03-27T13:47:26.82Z
  • 2016-03-27T13:47:26.8Z

Date Math

The date field types also supports date math expressions, which makes it easy to create times relative to fixed moments in time, include the current time which can be represented using the special value of "NOW".

Date Math Syntax

Date math expressions can do two things: they can specify a time period by adding time units to the current time, and also round the time to a specified unit. Expressions can be chained and are evaluated left to right.

For example: this represents a point in time two months from now, from the millisecond:


This is one day ago, to the millisecond:


A slash is used to indicate rounding. Below is a point in time yesterday, rounded to the previous hour, with millisecond precision (For example, if the current time is 15:42:17.2165, the point below is 15:00:00.0000 yesterday):


Below is yesterday at 00:00:00.0000AM:


Here is the supported keywords in Date Math:
Date part keywords
Alternatives keywords
Description Round part?
It represents current date time.
It represents the year part of date time.
It represents the month part of date time.
It represents the day part of date time.
It represents the hour part of date time.
MINUTE MINUTES It represents the minute part of date time.
SECOND SECONDS It represents the second part of date time.