howto_user (howto_user) wrote in s2howto,
howto_user
howto_user
s2howto

Date and Time Formats

Many layouts offer you the ability to change the way the date or the time is displayed in your layout; this option is available in the layout's customization wizard.

In order to format the date and time the way you'd like, you will need to use the variables described below. You can put these together in any order you want, with any other text you want, in order to display the date/time the way you'd like it. None of these variables are required, so if you don't want to display any particular portion of the date/time, you can simply omit that variable.

For example, if you use "%%da%%, %%mon%%. %%dayord%% (%%yyyy%%)", the date will be displayed as "Tue, Feb. 5th (1980)". Similarly, "%%m%%/%%yyyy%%" will appear as "2/2006", and so on.


Time Formats

Hour
%%H%%
Hour, 0-23.
%%HH%%
Hour, 00-23.
%%h%%
Hour, 1-12.
%%hh%%
Hour, 01-12.
Minute
%%min%%
Minute, 00-59.
Seconds
%%sec%%
Second, 00-59.
AM/PM
%%a%%
"a" for am, "p" for pm
You can use %%a%%m to form "am" or "pm"
%%A%%
"A" for am, "P" for pm
You can use %%A%%M to form "AM" or "PM"

Date Formats

Day of Week
%%da%%
Short day of week, translated. (English: Sun, Mon, …)
%%day%%
Long day of week, translated. (English: Sunday, Monday, …)
Day
%%d%%
Day, 1-31.
%%dd%%
Day, 01-31.
%%dayord%%
Ordinal day of week, translated. (English: 1st, 2nd, 3rd, …)
Month
%%m%%
Month, 1-12.
%%mm%%
Month, 01-12.
%%mon%%
Short month name, translated. (English: Jan, Feb, …)
%%month%%
Long month name, translated. (English: January, February, …)
Year
%%yy%%
Year, two digits.
%%yyyy%%
Year, four digits.

Tags: date, format date/time, time
Subscribe
Comments for this post were disabled by the author