Thursday, February 7, 2013

help with date parsing and time zones

I'm allowing the user to input a date and time and I'm using the pattern:

    DateTimeFormat format = DateTimeFormat.getFormat("yyyy-MM-dd HH:mm");

However, the date is specified as UTC, so if a user were to put in:

    2013-01-01 15:30

This will parse fine, but when printing out the parsed date is says (essentially):

   Jan 1st 2013 15:30 GMT-8

Where I would like this to be either:
 
  Jan 1st 2013 15:30 GMT
  Jan 1st 2013 7:30 GMT-8

I know the docs says:

  "In the current implementation, timezone parsing only supports GMT:hhmm, GMT:+hhmm, and GMT:-hhmm."

But I don't know what that means.  Do I adjust my pattern to include this?  Does the input time need to have GMT in it somewhere?  Thanks!




--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment