On other more complex pages (where there are lists of articles with dates etc) I've used a macro to generate the HTML, and in XSLT I've been able to format the date to a specified format (dd.mm.yyyy). Is it possible to format the date in an umbraco field in a template, or do I need to create a macro just to output this date in a specific format?
Formatting can be done on the umbraco item. Just use the insert item dialog, and select to format as date. Date will be formatted according to the current culture settings (based on culture settings for the node, will default to en-US if not set through 'Manage hostnames')
If you need more complex formatting, I'd suggest you use:
Date format in umbraco datepicker field
Hi,
I have a page which uses a simple datepicker field to put a date on a page:
On other more complex pages (where there are lists of articles with dates etc) I've used a macro to generate the HTML, and in XSLT I've been able to format the date to a specified format (dd.mm.yyyy). Is it possible to format the date in an umbraco field in a template, or do I need to create a macro just to output this date in a specific format?
Thanks all...
I'm very curious about how to achieve this as well. Anyone?
Dan, Filip,
Formatting can be done on the umbraco item. Just use the insert item dialog, and select to format as date. Date will be formatted according to the current culture settings (based on culture settings for the node, will default to en-US if not set through 'Manage hostnames')
If you need more complex formatting, I'd suggest you use:
(exactly as you would use it from xslt)
Hope this helps.
Regards,
/Dirk
If I am not mistaken, you could also set the language for the site which will then display dates in the format matching that language.
HTH,
Peter
Thanks Dirk,
You saved my peace of mind, yet again. I should use the umbraco.library methods more often!
greetings,
Anthony
is working on a reply...