FilipVolvo
Programmer
Can anyone explain this 'strange' result?
When I parse a date with the pattern yyyy-ww-E
I get a bad result!!!
pattern: yyyy-ww-E
parse : 2002-48-Sun -> in calendar
format : calendar -> 2002-47-Sun
WHY ?????
The Code:
----------
import java.util.*;
import java.text.*;
public class Test3 {
public static void main(String[] args) {
GregorianCalendar c = new java.util.GregorianCalendar();
c.setFirstDayOfWeek(c.MONDAY);
SimpleDateFormat sdf = new SimpleDateFormat();
sdf.setCalendar(c);
sdf.applyLocalizedPattern("yyyy-ww-E"
try {
c.setTime(sdf.parse("2002-48-Sun");
} catch (Exception e) {
e.printStackTrace();
}
System.out.println(sdf.format(c.getTime()));
}
}
With regards
Filip
When I parse a date with the pattern yyyy-ww-E
I get a bad result!!!
pattern: yyyy-ww-E
parse : 2002-48-Sun -> in calendar
format : calendar -> 2002-47-Sun
WHY ?????
The Code:
----------
import java.util.*;
import java.text.*;
public class Test3 {
public static void main(String[] args) {
GregorianCalendar c = new java.util.GregorianCalendar();
c.setFirstDayOfWeek(c.MONDAY);
SimpleDateFormat sdf = new SimpleDateFormat();
sdf.setCalendar(c);
sdf.applyLocalizedPattern("yyyy-ww-E"
try {
c.setTime(sdf.parse("2002-48-Sun");
} catch (Exception e) {
e.printStackTrace();
}
System.out.println(sdf.format(c.getTime()));
}
}
With regards
Filip