Configure the date and time format
Date and time calculation
On the frontend, Sitefinity CMS supports the following ways for calculating date and time:
Modify date and time calculation and format
You change the date and time settings by modifying the config.json file, located in the ~\SitefinityWebApp\AdminApp\ folder:
You do this by modifying the dateTimeFormat object, which has the following properties:
You can configure the following:
useBrowserLocale
By default, this property is set to false, which means that the date and time are calculated server-side.
If you set it to true, then date and time is calculated client-side.
browserLocaleFormatWidth
This property can be short, medium or long.
If this property is not provided and useBrowserLocale is true, it defaults to short.
timeFormat
This property accepts the following values:
dateFormat
This property accepts the following values:
EXAMPLE: Example behavior of
useBrowserLocale, if the browser's language is English (US).
- If the
browserLocaleFormatWidth is set to long, the formats used in the date and time field will be "h:mm:ss a" and "MMMM d, y", which looks like 9:22:13 am and July 10, 2021.
- If the
browserLocaleFormatWidth is set to medium, the formats used in the date and time field will be "h:mm:ss a" and "MMM d, y", which looks like 9:22:13 am and Jul 10, 2021.
- If the browserLocaleFormatWidth is set to shor,t the formats used in the date and time field will be
"h:mm a" and "M/d/yy", which will look like 9:22 AM and 7/10/2021.