Join us this Friday for AI in Action at the Virtual Happy Hour! This free virtual event is open to all—enroll now on Academy and don’t miss out.

 

format date per culture

Vote:
 

Is there any inbuilt functionality in episerver to format the dates according to culture? e.g. 3rd of May (English), 3 de enero (Spanish) etc. Thank you.

#150221
Jun 14, 2016 10:25
Vote:
 

Nope. Use standard .NET string.Format for that. Since the current thread will be set to the same culture as the current page it will work great. 

If you have a property with date, use the standard Html.PropertyFor() to render it. If you are unhappy with the format, add a new display template and matching UIHint on property to make a custom display template (using the .NET string.Format() to output the date in the display template) 

#150223
Edited, Jun 14, 2016 10:54
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.