Hi,
I have a property in a bean like this:
The date I get instantiated in my bean looks like this:Code:<property name="dateOfBirth"><value>1994-04-22 00:00</value></property>
date = Fri Apr 22 00:00:00 GMT-01:00 1994
ie, it is being created in my own locale (BST).
I made my own CustomDateEditor, which is just like the one supplied with Spring, but it has a constructor like this:
Using this, the date in my bean looks like this:Code:public CustomDateEditor(){ dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm"); dateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); allowEmpty = false; }
date = Thu Apr 21 23:00:00 GMT-01:00 1994
ie, an hour has been subtracted from the time, but the time zone remains the same.
I need dates in UTC, or GMT. I want my date to look like:
date = Fri Apr 22 00:00:00 GMT 1994
Can anyone help?
Thanks,
John


Reply With Quote