Kristian Waagan wrote:
> That said, I have a problem. Maybe I have missed something fundamental,
> but shouldn't it be possible to parse string specifications of date and
> time including a time zone specification?
>
> For instance (using parseDateTime):
> Thu Jan 25 08:18:28 CET 2007
> // Does not work -> Invalid format:
> // "Thu Jan 25 08:18:28 CET 2007" is malformed at "CET 2007"
> // Tried with different numbers of z
> DateTimeFormat.forPattern("EEE MMM dd HH:mm:ss zzz yyyy");
> // Parsed ok, but tz info is ignored and solution "hardcoded".
> DateTimeFormat.forPattern("EEE MMM dd HH:mm:ss 'CET' yyyy");
>
> I'm able to use Z instead of z and parse specifications with +/-HHmm,
> but did not manage to make it work with a textual specification as show
> in the documentation for Z in DateTimeFormat.
>
> Am I trying to do something that is not supposed to work (yet), or am I
> using the API in the wrong way?
Parsing of textual time zones isn't supported. This was originally done
as CET is a dubious time zone id (short time zone ids mean different
things in different parts of the world).
I definitely think we should parse long (normal) time zone ids, like
Europe/London (which we don't at present), but I'm unconvinced on short
timezone ids.
Stephen
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Joda-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/joda-interest