DateFormat does not give the correct date

0
I use DateFormat to display a date in the locale of the user. DateFormat.getDateInstance(DateFormat.FULL,locale).format(aDate); The same record is used for all users. If I set the date to 05/24/2010, it is displayed in all the locales as 05/23/2010: Sunday, May 23, 2010 dimanche 23 mai 2010 dimanche 23 mai 2010 Domingo, 23 de Maio de 2010 niedziela, 23 maja 2010 23 mai 2010 Sonntag, 23. Mai 2010 2010年5月23日 星期日 I tried with the database field Localize and not Localize with no luck. Does anyone have an idea?
asked
3 answers
1

If you only use the date, set the time to 12:00 to prevent date changes with day-light savings and other corrections.

answered
0

Probably it's due to a combination of the datetime attribute setting localize y/n, database value (UTC) and who's viewing the value. nice write up about dateTime handling can be found here

answered
0

Thanks for all the comments. I ended up setting the time to 12:00

I don't like it but it does the trick.

Here is how I set the time to 12:00. Please let me know if there is a better way.

parseDateTimeUTC(formatDateTimeUTC($MyDate,'dd-MM-yyyy 12:00:00'),'dd-MM-yyyy HH:mm:ss')

answered