Date Format

Modified on Wed, Jan 17 at 6:48 PM


Command: attribute

Value:  type="date"

Command: format

Use any valid specifiers inside the curly braces. 


Examples: date{dd/MM/yyyy} or date{yyyy-MM-dd} or date{MMMM dd, yyyy} 

 

NOTE: An attribute command with value: 

type="date" or type="datetime-local" 

must be added to the block to activate the picker.


A second block can be used for Time if desired. 


attribute      type="time"

format         Use any valid specifiers inside the curly braces. 

Example: date{h:mm:tt}


Specifier

Description

Example

yyyy

4-digit-year

2023

yy

2-digit-year 00 to 99

23

y

1 or 2-digit-year 0 to 99

23

MMMM

full name of month

September

MMM

abbreviated name of month

Sep

MM

The month, from 01 through 12

09

M

The month, from 1 through 12

9

dddd

full name of day

Friday

ddd

abbreviated name of day

Fri

dd

The day of the month, from 01 through 31

08

d

The day of the month, from 1 through 31

8

hh

The hour, using a 12-hour clock from 01 to 12

01

h

The hour, using a 12-hour clock from 1 to 12

1

HH

The hour, using a 24-hour clock from 00 to 23

13

H

The hour, using a 24-hour clock from 0 to 23

3

mm

The minute, from 00 through 59

01

m

The minute, from 0 through 59

1

tt

The AM/PM designator

AM

t

The first character of the AM/PM designator

A

Specifier

Description

Example

yyyy

4-digit-year

2023

yy

2-digit-year 00 to 99

23

y

1 or 2-digit-year 0 to 99

23

MMMM

full name of month

September

MMM

abbreviated name of month

Sep

MM

The month, from 01 through 12

09

M

The month, from 1 through 12

9

dddd

full name of day

Friday

ddd

abbreviated name of day

Fri

dd

The day of the month, from 01 through 31

08

d

The day of the month, from 1 through 31

8

hh

The hour, using a 12-hour clock from 01 to 12

01

h

The hour, using a 12-hour clock from 1 to 12

1

HH

The hour, using a 24-hour clock from 00 to 23

13

H

The hour, using a 24-hour clock from 0 to 23

3

mm

The minute, from 00 through 59

01

m

The minute, from 0 through 59

1

tt

The AM/PM designator

AM

t

The first character of the AM/PM designator

A

 

 -----------------------------------------------------------------------------------------------------------------


New Parameter added to format command:

now           same as now plus day (now -  stands for the current server date)
now plus day or (now day) or (now)
now minus day
now plus week or (now week)
now minus week
now plus month or (now month)
now minus month
now plus year or (now year)
now minus year

The now parameter will add (or subtract) the user input to the current (server) date.

Date format can be appended to the above separated by ::

Default format is mm/dd/yyyy


Please note that the date formats are different than the chart above when using 'now'.


Recognized date formats:


d               Day as either 1 or two digits without 0 (when applicable)

dd             Day as either 1 or two digits with 0 (when applicable)

ddd           Adds proper ending to Day (st, nd, rd or th)

DD            Weekday name

DDCAP      Weekday name in capital letters

m               Month as either 1 or two digits without 0 (when applicable)

mm            Month as either 1 or two digits with 0 (when applicable)

MM            Month name

MMCAP     Month name in capital letters

yy               Last two digits of year

yyyy           All four digits of year





Example:

now plus day::MM ddd, yyyy

If now is May 17th, 2022 and user entered 15 then the printout will be:

June 1st, 2022

Note: If the block contains a hide status command then the default value is added to or subtracted from the current server date. A 0 value will print the current server date. If this field wasn’t hidden initially then whatever data a user has saved previously will be used so please reset the fields before making such product available to users.


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article