Date & Time Helpers icon

Date & Time Helpers

The Date & Time helpers allow you to manipulate date and time values of various formats from connectors and triggers.

Overview

The Date & Time helpers allow you to manipulate date and time values of various formats from connectors and triggers. These are commonly used for tasks such as converting date/time values to different formats, or finding the difference between two date & time values.

Formatting the date

A date string or timestamp can be formatted into a particular style of writing using the Format date operation of the Date & Time Helpers connector. For instance, '2006-01-22' is represented by YYYY-MM-DD, while 'Sun, January 22nd 2006' is represented by ddd, MMMM Do YYYY. Note that you can escape said characters by using either \ or []. For example, when using the timezone reference: Z: date-time-helper-z

Table of Formats

Date and Times can be represented in any way you want by combining the variables in the following table. The Date & Time Helper connector supports time zones that are natively recognized by the JavaScript Date function, such as UTC, EST, and other standard time zone abbreviations.

TokenOutput
YearYY70 71 ... 29 30
YYYY1970 1971 ... 2029 2030
QuarterQ1 2 3 4
Qo1st 2nd 3rd 4th
MonthM1 2 ... 11 12
Mo1st 2nd ... 11th 12th
MM01 02 ... 11 12
MMMJan Feb ... Nov Dec
MMMMJanuary February ... November December
Week of YearW1 2 ... 52 53
Wo1st 2nd ... 52nd 53rd
WW01 02 ... 52 53
Day of YearDDD1 2 ... 364 365
DDDo1st 2nd ... 364th 365th
DDDD001 002 ... 364 365
Day of MonthD1 2 ... 30 31
Do1st 2nd ... 30th 31st
DD01 02 ... 30 31
Day of Weekd0 1 ... 5 6
E1 2 ... 6 7
do0th 1st ... 5th 6th
ddSu Mo ... Fr Sa
dddSun Mon ... Fri Sat
ddddSunday Monday ... Friday Saturday
AM/PMAAM PM
aam pm
HourH0 1 ... 22 23
HH00 01 ... 22 23
h1 2 ... 11 12
hh01 02 ... 11 12
k1 2 ... 23 24
kk01 02 ... 23 24
Minutem0 1 ... 58 59
mm00 01 ... 58 59
Seconds0 1 ... 8 9
ss00 01 ... 58 59
Fractional SecondS0 1 ... 8 9
SS00 01 ... 98 99
SSS000 0001 ... 998 999
SSSS ... SSSSSSSSS000[0..] 001[0..] ... 998[0..] 999[0..]
Time Zonez or zzEST CST ... MST PST
Z-07:00 -06:00 ... +06:00 +07:00
ZZ-0700 -0600 ... +0600 +0700
Unix TimestampX1360013296
Unix Millisecond Timestampx1360013296123

Important notes

Comparisons

Please remember that you either need to compare two times or two dates. You cannot compare a date to a time. datevsdate The boolean helper can help you compare two date **strings **should the issue arise. datetime-boolean-compare

Comparison example

Below is a simple walkthrough of how you can use the Date & Time Helper to compare timestamps within your workflow. datetime-wf-complete

Operations

Get current timestamp

Gets the current date and time in the format of your choosing. You can create a custom format if preferred. current-time

Get day of the week

Retrieves the day of the week from the date specified in the format of your choosing. current-time

Was this page helpful?