Date & time

The basics #

ListoWP uses two date formats when displaying a Task due date: short and long.

  • Short format is used to display a date which falls on the current calendar year.
    • The default is M j which translates to (for example) May 4
  • Long format is used for dates falling on any other year (past and future)
    • The default is M j, Y which translates to (for example) May 4, 1986

You are free to modify these date formats to ones that fit your use case best. First of all, date format is often a regional preference. You might also want full dates at all times, perhaps even including the time. Or maybe dates outside of the current year only to mention month & year without the day.

Examples #

We use standard PHP formatting to display the dates. You can use characters like dots, dashes, commas to format the date further.

  • F j, Y for standard “natural language” date = May 4, 1986
    • F j same as above but without year = May 4
    • For languages other than English the order may be different. In Polish it would be j F Y = 4 maja 1986
  • F jS, Y for more grammatically verbatim version = May 4th, 1986
    • F jS same as above but without year = May 4th
  • Y/m/d for YYYY/mm/dd standard = 1986/05/04
  • d-m-Y for dd/mm/YYY standard = 04-05-1986
  • To display a letter verbatim instead of being transformed as a format, prefix it with a backslash like this:
    • jS \d\a\y \o\f F = 4th day of May

Available formatting options #

CharacterDescriptionExample returned values
Day
dDay of the month, 2 digits with leading zeros01 to 31
DA textual representation of a day, three lettersMon through Sun
jDay of the month without leading zeros1 to 31
l (lowercase ‘L’)A full textual representation of the day of the weekSunday through Saturday
SEnglish ordinal suffix for the day of the month, 2 charactersstndrd or th. Works well with j
Month
FA full textual representation of a month, such as January or MarchJanuary through December
mNumeric representation of a month, with leading zeros01 through 12
MA short textual representation of a month, three lettersJan through Dec
nNumeric representation of a month, without leading zeros1 through 12
Year
YA full numeric representation of a year, at least 4 digits, with - for years BCE.Examples:  199920032030
yA two digit representation of a yearExamples: 99 or 03
Time
aLowercase Ante meridiem and Post meridiemam or pm
AUppercase Ante meridiem and Post meridiemAM or PM
g12-hour format of an hour without leading zeros1 through 12
G24-hour format of an hour without leading zeros0 through 23
h12-hour format of an hour with leading zeros01 through 12
H24-hour format of an hour with leading zeros00 through 23
iMinutes with leading zeros00 to 59
sSeconds with leading zeros00 through 59