-
Bug
-
Resolution: Duplicate
-
P1
-
1.3.1_21
-
None
-
x86
-
windows_2003
Brazilian Daylight Savings Time changed this year to start at midnight Sunday Oct 14th '07.
The first hour of the new day is reported as the last hour of the previous day.
Here are the results of some testing.
E:\Documents and Settings\jdsuser>java -version
java version "1.3.1_21"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_21-b02)
Java HotSpot(TM) Client VM (build 1.3.1_21-b02, mixed mode)
E:\Documents and Settings\jdsuser>java -showversion -Duser.timezone=America/Sao_Paulo TestDST "10/14/2007 0:0:0 AM"
java version "1.3.1_21"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_21-b02)
Java HotSpot(TM) Client VM (build 1.3.1_21-b02, mixed mode)
Saturday, October 13, 2007 11:00:00 PM BRT (America/Sao_Paulo) is not in daylight-savings time. <----------------***
E:\Documents and Settings\jdsuser>java -showversion -Duser.timezone=America/Sao_Paulo TestDST "10/13/2007 11:59:59 PM"
java version "1.3.1_21"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_21-b02)
Java HotSpot(TM) Client VM (build 1.3.1_21-b02, mixed mode)
Saturday, October 13, 2007 11:59:59 PM BRT (America/Sao_Paulo) is not in daylight-savings time. <----------------***
E:\Documents and Settings\jdsuser>java -showversion -Duser.timezone=America/Sao_Paulo TestDST "10/14/2007 0:0:1 AM"
java version "1.3.1_21"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_21-b02)
Java HotSpot(TM) Client VM (build 1.3.1_21-b02, mixed mode)
Saturday, October 13, 2007 11:00:01 PM BRT (America/Sao_Paulo) is not in daylight-savings time. <----------------***
E:\Documents and Settings\jdsuser>java -showversion -Duser.timezone=America/Sao_Paulo TestDST "10/14/2007 0:59:59 AM"
java version "1.3.1_21"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_21-b02)
Java HotSpot(TM) Client VM (build 1.3.1_21-b02, mixed mode)
Saturday, October 13, 2007 11:59:59 PM BRT (America/Sao_Paulo) is not in daylight-savings time. <----------------***
E:\Documents and Settings\jdsuser>java -showversion -Duser.timezone=America/Sao_Paulo TestDST "10/14/2007 1:0:0 AM"
java version "1.3.1_21"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_21-b02)
Java HotSpot(TM) Client VM (build 1.3.1_21-b02, mixed mode)
Sunday, October 14, 2007 1:00:00 AM BRST (America/Sao_Paulo) is in daylight-savings time. <----------------***
This is the test case.
// author: Johann Loefflmann
import java.util.*;
import java.text.*;
public class TestDST {
private static final String DATE_FORMAT_PATTERN = "MM/dd/yyyy hh:mm:ss a";
public static void main(String args[]) {
if (args.length < 1) {
System.out.println("Syntax: java TestDST \""+ DATE_FORMAT_PATTERN +"\"\n"
+"Example: java TestDST \"03/11/2007 2:00:00 AM\"");
System.exit(0);
}
String testDate = args[0];
TimeZone timeZone = TimeZone.getDefault();
SimpleDateFormat inFormat = new SimpleDateFormat(DATE_FORMAT_PATTERN);
DateFormat outFormat = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL);
Date date = inFormat.parse(testDate, new ParsePosition(0));
System.out.println(outFormat.format(date)
+ " (" + timeZone.getID() + ")"
+ " is "
+ (timeZone.inDaylightTime(date) ? "" : "not ")
+ "in daylight-savings time.");
}
}
The first hour of the new day is reported as the last hour of the previous day.
Here are the results of some testing.
E:\Documents and Settings\jdsuser>java -version
java version "1.3.1_21"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_21-b02)
Java HotSpot(TM) Client VM (build 1.3.1_21-b02, mixed mode)
E:\Documents and Settings\jdsuser>java -showversion -Duser.timezone=America/Sao_Paulo TestDST "10/14/2007 0:0:0 AM"
java version "1.3.1_21"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_21-b02)
Java HotSpot(TM) Client VM (build 1.3.1_21-b02, mixed mode)
Saturday, October 13, 2007 11:00:00 PM BRT (America/Sao_Paulo) is not in daylight-savings time. <----------------***
E:\Documents and Settings\jdsuser>java -showversion -Duser.timezone=America/Sao_Paulo TestDST "10/13/2007 11:59:59 PM"
java version "1.3.1_21"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_21-b02)
Java HotSpot(TM) Client VM (build 1.3.1_21-b02, mixed mode)
Saturday, October 13, 2007 11:59:59 PM BRT (America/Sao_Paulo) is not in daylight-savings time. <----------------***
E:\Documents and Settings\jdsuser>java -showversion -Duser.timezone=America/Sao_Paulo TestDST "10/14/2007 0:0:1 AM"
java version "1.3.1_21"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_21-b02)
Java HotSpot(TM) Client VM (build 1.3.1_21-b02, mixed mode)
Saturday, October 13, 2007 11:00:01 PM BRT (America/Sao_Paulo) is not in daylight-savings time. <----------------***
E:\Documents and Settings\jdsuser>java -showversion -Duser.timezone=America/Sao_Paulo TestDST "10/14/2007 0:59:59 AM"
java version "1.3.1_21"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_21-b02)
Java HotSpot(TM) Client VM (build 1.3.1_21-b02, mixed mode)
Saturday, October 13, 2007 11:59:59 PM BRT (America/Sao_Paulo) is not in daylight-savings time. <----------------***
E:\Documents and Settings\jdsuser>java -showversion -Duser.timezone=America/Sao_Paulo TestDST "10/14/2007 1:0:0 AM"
java version "1.3.1_21"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_21-b02)
Java HotSpot(TM) Client VM (build 1.3.1_21-b02, mixed mode)
Sunday, October 14, 2007 1:00:00 AM BRST (America/Sao_Paulo) is in daylight-savings time. <----------------***
This is the test case.
// author: Johann Loefflmann
import java.util.*;
import java.text.*;
public class TestDST {
private static final String DATE_FORMAT_PATTERN = "MM/dd/yyyy hh:mm:ss a";
public static void main(String args[]) {
if (args.length < 1) {
System.out.println("Syntax: java TestDST \""+ DATE_FORMAT_PATTERN +"\"\n"
+"Example: java TestDST \"03/11/2007 2:00:00 AM\"");
System.exit(0);
}
String testDate = args[0];
TimeZone timeZone = TimeZone.getDefault();
SimpleDateFormat inFormat = new SimpleDateFormat(DATE_FORMAT_PATTERN);
DateFormat outFormat = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL);
Date date = inFormat.parse(testDate, new ParsePosition(0));
System.out.println(outFormat.format(date)
+ " (" + timeZone.getID() + ")"
+ " is "
+ (timeZone.inDaylightTime(date) ? "" : "not ")
+ "in daylight-savings time.");
}
}
- duplicates
-
JDK-4845752 (tz) Wrong behavior JDK 1.3.1 in GregorianCalendar at DST boundary time
- Resolved