Customizing Date Format

We are using following variables to dispay date time format on various places on site.

 DATE_FORMAT,
 DATETIME_FORMAT,
 DATETIME_ELP_FORMAT,
 SHORT_DATETIME,
 SHORT_DATETIME_ZONE,
 SHORT_DATE

If we want to change default date format used at a specific place on the site, we need to do following steps.

1. Find the date format variable used at that place: access the page by passing devset=true in the url, it will display the dateTime

2.  Site Admin -> Site Details -> Customization : set variable with new format as desired.

 

Example : Dashboard page - Enrolled courses tab - Period datetime appears in dd MMM yyyy HH:MM format,

if Admin wants to change this format to use 12 hour clock and display timezone also.

  • Screen with default format -

  • Find date_time_format variable used at this place - To get that access the page with devset=true  [ to channge display back to normal use devunset=true]

 

  • Once we found what variable is used - Go to Site  Admin -> Site Detail -> Customization tab

           add  variable_name=new_format. In this example -

          DATETIME_FORMAT = dd MMM yyyy h:mm a z  and save settings.

  •   Reload dashboard page -

Date time formating specifiers:

dd - represents date

mm - month in number

MMM - Month name ( abbrebiated)

yyyy - year in four digits

hh - 12 hour clock , will show time in 2 digits like 01, 02.

h - 12 hour clock , will not show preceeding 0. like 1 PM

HH - 24 hour clock 

mm - minutes 

a - for displaying AM/PM

z - for displaying timezone.

 

 

 

 

 


Rating: