Monday, December 27, 2010

DateTimeFormat problem with parsing

Hi guys, I have a little, stupid problem but it seems that I can't
find solution for it. I need to parse string from TextField in a
DialogBox, but I'm continuously getting an exception
IllegalArgumentException when I try to parse it. Here is the format of
my string from a DialogBox.

Tue Dec 28 05:30:00 CET 2010

and here is a snippet from my code:
----------------------------------------------------------------------------
String str = eventWhenText.getText();

// here is a pattern

DateTimeFormat dtf = DateTimeFormat.getFormat("EEE MMM dd HH:mm:ss
zzz yyyy");

Date date = dtf.parse(str); // and here it fires an exception

---------------------------------------------------------------------------

As I know, the pattern is correct, and I checked it many times.
I would appreciate any help. Thanks.

Best Regards,

Luka Matovic

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate