Support Center

Please check docs.livewhale.com for the most up-to-date LiveWhale CMS and LiveWhale Calendar documentation. The below legacy documentation will remain available as a reference until the documentation migration is complete.

Formatting Date and Time

Last Updated: Jan 16, 2015 08:45AM PST

LiveWhale uses PHP's date formatting functions. You can use the following date formatting characters below to build date format strings to use in LiveWhale widgets. See the date and formatting options with examples below:

Day of Month

%d

Numeric, with leading zeros

01-31

%j

Numeric, without leading zero

1-31

%S

The English suffix for the day of the month

st, nd, or th in the 1st, 2nd, or 15th

Weekday

%l

Full name (lowercase 'L')

Sunday - Saturday

%D

Three letter name

Mon - Sun

Month

%m

Numeric, with leading zeros

01-12

%n

Numeric, without leading zeros

1-12

%F

Full text month

January - December

%M

Three letter textual

Jan - Dec

Year

%Y

Numeric, 4 digits

Ex., 1999, 2003

%y

Numeric, 2 digits

Ex., 99, 03

Time

%a

Lowercase

am, pm

%A

Uppercase

AM, PM

%g

Hour, 12-hour, without leading zeros

1-12

%h

Hour, 12-hour, with leading zeros

01-12

%G

Hour, 24-hour, without leading zeros

0-23

%H

Hour, 24-hour, with leading zeros

00-23

%i

Minutes, with leading zeros

00-59

%s

Seconds, with leading zeros

00-59

%T

Timezone abbreviation

Ex., EST, PST

Month

%c

ISO 8601

2004-02-14T15:19:25+00:00

%r

RFC 2822

Sat, 14 Feb 2015 16:01 +0200

Examples

Here are some examples of date format strings and result output that can be used in LiveWhale widgets.

The % sign means that the format character should represent a format variable and not a string that would display "as-is".