Changing Date & Time Format

All date and time formats are expected to be in php’s date format. A list of formatting options available is given at the bottom of this page.

Date & time formats for entering dates

This section relates to the formats of dates and times as they are entered on an event’s admin page.

Date input

In Event Organiser > Settings > General, the plug-in provides an option to select the format in which dates should be added. The available formats are:

  • yyyy-mm-dd (default)
  • dd-mm-yyyy
  • mm-dd-yyyy

(Note, the above formats are not shown in the php format, but ‘human readable’ format)

Time input

There is no option for changing whether time input should be in 12 or 24 hours. The plug-in decides which to use based on your site’s on the time format option in Settings > General. If that time format is in a 24-hour format, then the plug-in expects time to be entered in 24 hour format( e.g. 18:00), otherwise it expects 12 hour format (6:30pm).

You can force the plug-in to expect 12, or 24 hour time by using the eventorganiser_blog_is_24 filter (see documentation for the eventorganiser_blog_is_24 filter).

Time formatting is not strict: you can omit leading 0s and am and pm can be translations in the language the site is in.

Date & time formats in the widgets & shortcodes

fullCalendar shortcode

There are various dates that can be formatted on the fullCalendar, including:

  • An event’s date(s)
  • The ‘title’ of the calendar (in day, week and month view)
  • The columns of the calendar (in day, week and month view)

These are detailed on the fullCalendar shortcode page.

event list shortcode & widget

The date/time formats for event list shortcode and widgets can be edited in a number of ways:

  1. Changing your date/time options in Settings > General (note: these options may be used by other plug-ins or your theme)
  2. Editing the templates
  3. Using placeholder tags

Editing the appearance of the shortcodes and widgets are discused in more detail on the event list shortcode and event list widget pages.

Changing the date/time formats by editing the shortcode templates, involves copying the template files shortcode-event-list.php and widget-event-list.php from wp-content/event-organiser/templates into your theme and replacing the $date_format and $time_format variables as desired. By default these take the value of the date and time format options as set in your site’s Settings > General

Alternatively you can use placeholder tags and specify a date and time format: %start{M jS, Y}{ g:i:a}%, displays a date of the form March 6th, 2014 11:55am. The second argument is only used if the event is not an all-day event. Therefore, it is typically used for setting the time format.

Date & time format options on the event pages

The default date & time format used for the event pages (including an event’s page) are as follows:

  • Date format: d F Y (e.g 6 March 2014)
  • Time format: The format specified by the time format option in Settings > General .

Format list

The following is an incomplete list of the format characters available. You can find a complete list on the php.net website: http://php.net/manual/en/function.date.php.

Date format

format character Description Example returned values
d Day of the month, 2 digits with leading zeros 01 to 31
D A textual representation of a day, three letters Mon, Tue, …, Sun
j Day of the month without leading zeros 1 to 31
l (lowercase ‘L’) A full textual representation of the day of the week Sunday, Monday, …, Saturday
N ISO-8601 numeric representation of the day of the week 1 (for Monday) through 7 (for Sunday)
S English ordinal suffix for the day of the month, 2 characters st, nd, rd or th.
w Numeric representation of the day of the week 0 (for Sunday) through 6 (for Saturday)
z The day of the year (starting from 0) 0 through 365
W ISO-8601 week number of year, weeks starting on Monday Example: 42 (the 42nd week in the year)
F A full textual representation of a month January, Febuary, …, December
m Numeric representation of a month, with leading zeros 01 through 12
M A short textual representation of a month, three letters Jan, Feb, …, Dec
n Numeric representation of a month, without leading zeros 1 through 12
Y A full numeric representation of a year, 4 digits 2006, 2014
y A two digit representation of a year 06 or 14

Time format

format character Description Example returned values
g 12-hour format of an hour without leading zeros 1 through 12
G 24-hour format of an hour without leading zeros 0 through 23
h 12-hour format of an hour with leading zeros 01 through 12
H 24-hour format of an hour with leading zeros 00 through 23
i Minutes with leading zeros 00 to 59
s Seconds, with leading zeros 00 through 59
a Lowercase Ante meridiem and Post meridiem am or pm
A Uppercase Ante meridiem and Post meridiem AM or PM
e Timezone identifier UTC, GMT, Atlantic/Azores,…
T Timezone abbreviation EST, MDT …

source: http://php.net/manual/en/function.date.php.