| Author |
Time Zone Z associated with date
|
prince davies
Ranch Hand
Joined: May 08, 2009
Posts: 74
|
|
IN xsd date is represented like <endDateTime>2011-08-02Z</endDateTime>
if you look closer you see "z" associated with the date.
When i use format method to get string ,it will return me correct data.
but when i convert date string to date ,it returns me wrong date ,
format = August 2, 2011
parse = august 01.2011
how do i resolve this issue?
|
 |
prince davies
Ranch Hand
Joined: May 08, 2009
Posts: 74
|
|
|
i need this method should return date object and date should be standardized one or it should be accordance with the date stored in database (time zone)
|
 |
prince davies
Ranch Hand
Joined: May 08, 2009
Posts: 74
|
|
public String formatGMTDate(Date date) {
String result = " ";
if (date != null) {
SimpleDateFormat gmtFormat = new SimpleDateFormat(DATE_FORMAT, getLocale());
TimeZone gmtTime = TimeZone.getTimeZone("GMT");
gmtFormat.setTimeZone(gmtTime);
result = gmtFormat.format(date);
}
return result;
}[/code]
or
|
 |
 |
|
|
subject: Time Zone Z associated with date
|
|
|