Date.DayOfWeek()

DayOfWeek(date) => Returns the name of the day of week that the date falls on
Name Type Description
date Date The Date to use
Date.DayOfWeek(Date("10/21/2021")); => 'Thursday'

Date.Add()

Add(date, value, part) => Returns the new date after adding to it
Name Type Description
date Date The Date to use
value Number The amount to add to the date
part Text The type of amount to add (see table below)

NOTE: These date part strings are only for Date.Add, Date.Part and Date.Diff. If you are using Text or Date to format or create dates, check out the formatting docs.

This function adds (or subtracts if you use a negative number) the number of parts to the date. Specify part using Text as:

Part Result
y Adds Years
year Adds Years
years Adds Years
mm Adds Months
month Adds Months
months Adds Months
d Adds Days
day Adds Days
days Adds Days
h Adds Hours
hour Adds Hours
hours Adds Hours
m Adds Minutes
minute Adds Minutes
minutes Adds Minutes
s Adds Seconds
second Adds Seconds
seconds Adds Seconds
Date.Add(Date("10/21/2021"), 1, 'day'); => "10/22/2021"

Date.Diff()

Diff(date1, date2, part?) => Returns the difference between date1 and date2 as a number.
Name Type Description
date1 Date The first date
date2 Date The second date
part? Text The type of amount to return (see table below), if not specified it will return days

NOTE: These date part strings are only for Date.Add, Date.Part and Date.Diff. If you are using Text or Date to format or create dates, check out the formatting docs.

This function subtracts date2 from date1 and returns the value in the units specified by part?. If part? is not specified, it will default to returning days.

Part Result
y Returns Years
year Returns Years
years Returns Years
mm Returns Months
month Returns Months
months Returns Months
d Returns Days
day Returns Days
days Returns Days
h Returns Hours
hour Returns Hours
hours Returns Hours
m Returns Minutes
minute Returns Minutes
minutes Returns Minutes
s Returns Seconds
second Returns Seconds
seconds Returns Seconds
ms Returns Milliseconds
millisecond Returns Milliseconds
milliseconds Returns Milliseconds
Date.Diff(Date("10/21/2021"), Date("10/20/2021")); => 1

Date.DatePart()

DatePart(date, part) => Returns the requested part of the date as a number
Name Type Description
date Date The date
part Text The part of the date to extract

NOTE: These date part strings are only for Date.Add, Date.Part and Date.Diff. If you are using Text or Date to format or create dates, check out the formatting docs.

Part Result
y Returns Years
year Returns Years
years Returns Years
mm Returns Months
month Returns Months
months Returns Months
d Returns Days
day Returns Days
days Returns Days
h Returns Hours
hour Returns Hours
hours Returns Hours
m Returns Minutes
minute Returns Minutes
minutes Returns Minutes
s Returns Seconds
second Returns Seconds
seconds Returns Seconds
ms Returns Milliseconds
millisecond Returns Milliseconds
milliseconds Returns Milliseconds
Date.DatePart(Date("10/21/2021"), 'month'); => 10

Date.Week()

Week(date) => Returns the week number that the date falls on.
Name Type Description
date Date The date
Date.Week(Date("10/21/2021")); => 42

Date.ToUtc()

ToUtc(date) => Returns the date converted to the UTC timezone.

Note: If the date does not have timezone information, it will be assumed to be in UTC already.

Name Type Description
date Date The date
Date.ToUTC(Date("10/21/2021 10:58:28 +8")); => 2021-10-21T02:58:28+00:00

Date.ConvertTimeZone()

ConvertTimeZone(date, timezone) => Returns the date in the requested timezone.
Name Type Description
date Date The date
timezone Text The timezone name from the TZ database name column on wikipedia
Date.ConvertTimezone(Date("2021-10-21T19:30:59.3780063+00:00"), "America/Los_Angeles"); => 2021-10-21T12:30:59.3780063+00:00