Skip to main content

Date

Operation

Format

Description

Example

Convert to Date

ConvertToDate({Input})

Converts a specified value to a formatted date.

Input: ConvertToDate(“12/01/2020”)

Result: 12/01/2020

Next Day of Week

NextDayOfWeek({ReferenceDate}, {WeekDay}, {IsTodayCount}, {ZoneId})

Returns the next occurrence of the specified day of the week for a specified date and time zone.

Input: NextDayOfWeek("1/23/2020", "MONDAY", "True", "America/Los_Angeles")

Result: 1/27/2020

Previous Day of Week

PreviousDayOfWeek({{ReferenceDate}, {WeekDay}, {IsTodayCount}, {ZoneId})

Returns the previous occurrence of the specified day of the week for a specified date and time zone.

Input: PreviousDayOfWeek("2/23/2020", "MONDAY", "True", "America/Los_Angeles")

Result: 2/20/2020

Table 1. Date Format Examples

Format

Example

MM/dd/yyyy

01/02/2018

dd MMMM yyyy

02 January 2018

MMMM dd, yyyy

January 02, 2018

dd-M-yyyy hh:mm:ss

02-1-2018 06:07:59

dd MMMM yyyy zzzz

02 January 2018 India Standard Time

E, dd MMM yyyy HH:mm:ss z

Tue, 02 Jan 2018 18:07:59 IST



Table 2. Date Format Syntax

Character

Description

Examples

G

Era

CE

y

Year

  • 2018 (yyyy)

  • 18 (yy)

M

Month

  • January (MMMM)

  • Jan (MMM)

  • 01 (MM)

w

Results in week in year

16

W

Results in week in month

3

D

Count of days in year

266

d

Day of the month

  • 09 (dd)

  • 9 (d)

F

Day of the week in month

4

E

Name of the day in the week

  • Tuesday

  • Tue

u

Day number of week (based on Monday = 1)

2

a

AM or PM period designation

AM

H

Hour of the day (0-23)

12

k

Hour of the day (1-24)

24

K

AM hour of the day in 12-hour format (0-11)

0

h

PM hour of the day in 12 hour format (1-12)

12

m

Minute in the hour

59

s

Second in the minute

35

S

Millisecond in the minute

978

z

Time zone

  • Pacific Standard Time

  • PST

  • GMT-08:00

Z

Time zone offset in hours (RFC format)

-0800

X

Time zone offset (ISO format)

  • -08

  • -0800

  • -08:00