janh
12 years agoMentor
Rest API call for Date to show user selected Date Format
Hi there,
Currently we use the following code to pull the date from a post and then display at a particular date format, 'MM/dd/yyyy':
<#assign date = message.post_time?datetime("yyyy-MM-dd'T'HH:mm:ss'+00:00'") />
${date?string("MM/dd/yyyy")} ${message.post_time.@view_time}
The output would look like as follows: 02/27/2012 05:59 PM , which works well enough but I noticed that users can select their own format like dd-MM-yyyy or yyyy-MM-dd.
Does anyone know if there is a way to get the date format selected by the user in their settings so the code can display the date as per their format setting?
Cheers