Blog

Date Formatting

Posted by:

You are here:
← All Topics

You can change the format of a date using the “Format” setting of the date picker

It supports these characters

Date Format Characters

CharacterDescriptionExample
dDay of the month, 2 digits with leading zeros01 to 31
DA textual representation of a dayMon through Sun
l (lowercase ‘L’)A full textual representation of the day of the weekSunday through Saturday
jDay of the month without leading zeros1 to 31
JDay of the month without leading zeros and ordinal suffix1st, 2nd, to 31st
wNumeric representation of the day of the week0 (for Sunday) through 6 (for Saturday)
WNumeric representation of the week0 (first week of the year) through 52 (last week of the year)
FA full textual representation of a monthJanuary through December
mNumeric representation of a month, with leading zero01 through 12
nNumeric representation of a month, without leading zeros1 through 12
MA short textual representation of a monthJan through Dec
UThe number of seconds since the Unix Epoch1413704993
yA two-digit representation of a year99 or 03
YA full numeric representation of a year, 4 digits1999 or 2003
ZISO Date format2017-03-04T01:23:43.000Z

Time format character

CharacterDescriptionExample
HHours (24 hours)00 to 23
hHours1 to 12
GHours, 2 digits with leading zeros1 to 12
iMinutes00 to 59
SSeconds, 2 digits00 to 59
sSeconds0, 1 to 59
KAM/PMAM or PM

Changing the language

By default, the plugin shows the dates in English but you can change them using a translation.

There are several plugins that can translate the dates. As an example, we are going to show how to do it using the free plugin Loco Translate

1.- Once loco translate is installed go to Loco Translate/Plugins

2.- Select “All in one forms”

3.- Click on “new language”

4.- Select the language that you want to use. It needs to match the language of your site

It is also recommended to host the translation file under /loco/plugins. If you place it inside the all-in-one plugin’s folder it will be deleted when you update the plugin.

5.- Click on “start translating”

6.- Look for the text that you want to translate and translate it

7.- After finishing translating the strings click in save

8.- That’s it! after saving the dates will be translated

0

About the Author:

Im programmer working for an international company. I have programmed since i was 12 and i have done it professionally for 6 years. Programming for a company is fun and i have learned a lot of things but i have always been interested in running my own business so i decided to give it a shot doing what i do best, programming stuffs.
  Related Posts
  • No related posts found.