Forums Register Login

Can't parse dates with full zone name

+Pie Number of slices to send: Send
I am trying to parse a date with full zone names like 'Canada/Newfoundland' as shown below-
But it leads to exception-
Any ideas?
+Pie Number of slices to send: Send
Well I just gone through the Docs of SimpleDateFormat class.

Format Pattern
--------------
"yyyy.MM.dd G 'at' hh:mm:ss z" ->> 1996.07.10 AD at 15:08:56 PDT
"EEE, MMM d, ''yy" ->> Wed, July 10, '96
"h:mm a" ->> 12:08 PM
"hh 'o''clock' a, zzzz" ->> 12 o'clock PM, Pacific Daylight Time
"K:mm a, z" ->> 0:00 PM, PST
"yyyyy.MMMMM.dd GGG hh:mm aaa" ->> 1996.July.10 AD 12:08 PM

I was not able to find the format you are giving it. I think it should be modified.

HTH
+Pie Number of slices to send: Send
Go through the TimeZone and DateFormat classes and you can get a TimeZone object from Canada/Newfoundland, then pass it to your DateFormat object. That might sort out your problem.
Catch Ernie! Catch the egg! And catch this tiny ad too:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1717 times.
Similar Threads
Time zone problem in date format
current time problem on AIX
date format conversion to MM/dd/yyyy hh:mm a
Calendar() / Date() bug ???
SimpleDateFormat year problem
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 16:27:25.