Hi Brian!
> You need to use "xxxx" instead of "yyyy" for parsing weekyear. The 
> reason you're seeing the date off by so much has to do with the order in 
> which parsed fields are computed. The year is set first, and then the 
> week. Parsing 2005 as "yyyy" yields 2005-01-01 which is also 2004-W53. 
> Setting the week to 3 leaves the weekyear as 2004. Parsing 2005 as 
> "xxxx" yields 2005-W01.
>   
Ah - great - thanks! Will try so.

Ciao,
Mario

> Mario Ivankovits wrote:
>   
>> Hi!
>>
>> The following code snipped:
>>
>>         DateTime dt =
>> DateTimeFormat.forPattern("ww.yyyy").withLocale(Locale.ENGLISH).parseDateTime("03.2005");
>>         System.err.println(dt.toString());
>>         dt =
>> DateTimeFormat.forPattern("ww.yyyy").withLocale(Locale.ENGLISH).parseDateTime("03.2006");
>>         System.err.println(dt.toString());
>>         dt =
>> DateTimeFormat.forPattern("ww.yyyy").withLocale(Locale.ENGLISH).parseDateTime("03.2007");
>>         System.err.println(dt.toString());
>>
>> outputs
>>
>> 2004-01-12T00:00:00.000+01:00
>> 2005-01-17T00:00:00.000+01:00
>> 2007-01-15T00:00:00.000+01:00
>>
>> Why this?
>> Why are the first two parsings off by one year?
>>
>> I've tried it with joda 1.4 release.
>>
>> Thanks!
>> Ciao,
>> Mario
>>
>>
>> -------------------------------------------------------------------------
>> 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
>>
>>   
>>     
>
> -------------------------------------------------------------------------
> 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
>
>   


-------------------------------------------------------------------------
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

Reply via email to