We have an application which now needs to support international user-dependent date formats. This means date fields shown to the user will depend on his/her locale.
The date format configuration in Service Center works system-wide and is thus not suitable for this requirement. Do you know any simple way to implement this? I know we could search for all the date occurrences in our screens/blocks and filter them through a date-formatting function but this would be quite error-prone (and boring also :)!)
Thanks for your help,
I don't have good news :). Date/time handling and localization is a bit of a pain in the Platform. Apart from what you already suggested I don't have a solution.
Thanks for your input - going through the code manually and using a date-formatting function seems to be the solution.
I played around with this problem a while ago and sort of got a solution...
The trick is that it becomes the BROWSER that must decide what time actually gets displayed based on its locale. The server handles all times in UTC.
At the end of the day, I sighed and resorted to setting a Site TimeZone offset which I added to the current time before displaying. I'm still new to all this so perhaps there is a way to make things simpler but hopefully this can at least give you a hint of what can work.
The Platform servers run in local time, and I've never encountered UTC supplied dates, except from external web services. Indeed, recently on this forum someone had the problem of running of an Amazon server located in the US, while working in Europe, and having wrong timestamps because of that.
Also, the OP asked about date/time formatting, not UTC offset conversion.
Good points Kilian - I should read things a bit more carefully.
Nevertheless, using this technique (ensuring the server time is converted to UTC before rendering the page) does allow his local times to be formatted according to individual browser locale.
Thank you all for your input! My question's main concern was to find a way to easily and quickly format all date strings (without the hh:mm part) across an entire application depending on the user's preferences (locale).
Until now, it looks like there is no way around manually changing all expressions on all web screens/blocks and filter the date fields through a formatting function.