United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6609359 (tz) TimeZone.inDaylightTime() does not work
JDK-6609359 : (tz) TimeZone.inDaylightTime() does not work

Details
Type:
Bug
Submit Date:
2007-09-26
Status:
Closed
Updated Date:
2010-07-29
Project Name:
JDK
Resolved Date:
2007-10-16
Component:
core-libs
OS:
windows_xp
Sub-Component:
java.util:i18n
CPU:
x86
Priority:
P4
Resolution:
Duplicate
Affected Versions:
5.0
Fixed Versions:

Related Reports
Duplicate:

Sub Tasks

Description
FULL PRODUCT VERSION :
java version "1.5.0_10"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_10-b03)
Java HotSpot(TM) Client VM (build 1.5.0_10-b03, mixed mode, sharing)

Also repeatable on:
1.5.0_08
1.5.0_09
1.6.*

Regression: it works on 1.5.0_07 and earlier.

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
Linux expo 2.6.8-3-686 #1 Tue Dec 5 21:26:38 UTC 2006 i686 GNU/Linux



A DESCRIPTION OF THE PROBLEM :
Method TimeZone.inDaylightTime(Date) returns false for any argument.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run the source code.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Output:
date: 2005-01-01; dst=false
date: 2005-07-01; dst=true

ACTUAL -
date: 2005-01-01; dst=false
date: 2005-07-01; dst=false


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.text.*;
import java.util.*;

public class tztest {
  private static final DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
  private static final TimeZone tz = TimeZone.getTimeZone("EST");

  public static void main(String[] args) throws ParseException {
    check("2005-01-01");
    check("2005-07-01");
  }

  private static void check(String s) throws ParseException {
    Date date = format.parse(s);
    System.out.println("date: " + s + "; dst=" + tz.inDaylightTime(date));
  }
}

---------- END SOURCE ----------

                                    

Comments



Hardware and Software, Engineered to Work Together