The following typical scenarios and operations will
produce incorrect results, as a consequence of using the time offset by
one hour.
- Time format and display
- Time zone name display
- Operations that check whether a particular date is in
daylight savings
- Computations and/or business logic based on daylight
savings time
- Any of the above that run on a system on which time is set
to a time zone other than the US time zone, but does computations based on
a US time zone
The following SDK classes provide APIs to use date, time, and time zone
functionality:
java/text/DateFormat
java/textSimpleDateFormat
java/util/Date
java/util/Calendar
java/util/GregorianCalendar
java/util/SimpleTimeZone
java/util/TimeZone
The following examples demonstrate the effects of not applying
fixes for the US DST changes:
Actual Output (without US DST
changes) :
Mon Mar 12 10:30:14 PST 2007
Currently not in daylight-savings time.
Expected Output (with US DST changes):
Mon Mar 12 11:30:14 PDT 2007
Currently in daylight-savings time.
- If computations or any business logic are made based on
daylight saving time, incorrect results can be expected.
Example: The following code demonstrates how computations or business
logic executed can vary based on whether a particular date is in
daylight.
/* The code below checks if a particular
date is in daylight saving time in the "America/New_York" time zone.
*/
import java.util.*;
...
TimeZone tz=TimeZone.getTimeZone("America/New_York");
SimpleDateFormat dateFormat = new
SimpleDateFormat("dd/MM/yyyy");
dateFormat.setTimeZone(timeZone);
try{
System.out.println("12/03/2007: " +
timeZone.inDaylightTime(dateFormat.parse("12/03/2007")));
}
catch (Exception e) {
e.printStackTrace();
}
Actual Output (without US DST changes) :
12/03/2007: false
Expected Output (with US DST changes):
12/03/2007: true
Note: All the output in the previous examples assumes that the date
on the host system is set to 12 March 2007, which is in daylight saving
time as a result of time zone changes being implemented in the US in 2007.
Examples of possible business impact:
- Travel industry: Errors in date and time for arrivals and
departures.
- Errors in scheduled bank transactions possibly resulting
in late payments and customer dissatisfaction.
- Errors resulting in loss of customer benefit (for example,
application for admission to a college with a timed deadline could result
in student not receiving admission).
- Errors resulting in legal liability (for example, errors
in a web based system for submitting legal briefs could lead to the brief
not being submitted on time).
- Sales that take effect or end at certain times.
Miscalculation could lead to customer dissatisfaction at missing
sale.
- Sales projection calculations (by hour) would be
erroneous.
- Cell phone rate calculations (charges based on when "night
minutes" begin) could be affected.
- Errors in calendar management (scheduling meetings, for
example).
In short, any date or time calculation could be affected.
For more details on DST and WebSphere Application Server, refer to see the
Daylight
Saving Time (DST) 2007 Information for WebSphere Application
Server. |