Name: krT82822 Date: 05/27/99
If Windows' date/time control panel's "Automatically adjust clock for daylight savings changes" is on, there is a one-hour discrepancy between
the last-modified time shown by the Win/DOS "dir" command (for a file created during STANDARD time) and the last-modified time returned
by File.lastModified() (when the current date falls during Daylight Savings Time).
This means that Bug 4077832 appears to still exist in JDK 1.2.1, though it was nominally fixed for JDK 1.2beta4 (fixed unverified).
------------------------------
User description:
Some simple test source (WIN/95) and a file with a date
stamp of Sun Feb 28 10:49:44 PST 1999
import java.awt.*;
import java.applet.*;
import java.io.*;
import java.lang.*;
import java.net.*;
import java.util.Date;
public class T
{
public static void main (String[] argv) {
System.out.println("Runnin T, If JVM 1.2 the timestamp is wrong");
File tmp = new File("crome.sup");
if (tmp.exists()) {
Date d = new Date(tmp.lastModified()) ;
System.out.println( d + " - or - " + d.toGMTString());
} else {
System.out.println( "error no file crome.sup" );
}
}
}
DIR CROME.SUP
Volume in drive C has no label
Volume Serial Number is 1B6A-14E9
Directory of C:\WebApps\Crome
CROME SUP 58,844 02-28-99 10:49a crome.sup
1 file(s) 58,844 bytes
0 dir(s) 3,447.53 MB free
Now run under different VMs note the incorrect offset of
the file lastModified under 1.2.1
java version "1.1.7B"
Runnin T, If JVM 1.2 the timestamp is wrong
Sun Feb 28 10:49:44 PST 1999 - or - 28 Feb 1999 18:49:44 GMT
java version "1.2.1"
HotSpot VM (1.0fcs, mixed mode, build E)
Runnin T, If JVM 1.2 the timestamp is wrong
Sun Feb 28 09:49:44 PST 1999 - or - 28 Feb 1999 17:49:44 GMT
(Review ID: 83597)
======================================================================
Name: krT82822 Date: 05/27/99
In WinNt user have an option of turning Daylight Saving Time (DST) on and off, in JAVA it always on.
To reproduce the problem:
1. Start Date/Time Properties dialog
2. Set time to 1:56 a.m. and date to the first sunday of april of any year
(April 4 1999)
3. Uncheck "Automatically adjust click for DST" in Time Zone page and press
Apply/OK
4.
while(1)
{
try{
System.out.println(new Date().toString());
Sleep(60*2000);
}catch(Exception e){}
}
You will see the timestamp like 1999/04/04 01:58:35 EST
5. In 2 min the timestamp will be 1999/04/04 03:00:35 EDT. When NT clock shows that time is 02:00:35 EST
(Review ID: 83559)
======================================================================
Name: rlT66838 Date: 11/04/99
java full version "JDK-1.2.2-001"
This is exactly the same problem as described in bug number 4077832,
except that my platform is Windows 95, and the problem has not been fixed.
To recap: the result of java.io.File.lastModified() gives different
results for the same file (untouched between runs) before and after
a Daylight Savings switchover.
I first ran across the problem on a "1.2-V" installation.
Since the original defect report claimed to have fixed this
(for NT at least) in 1.2beta4, I tried upgrading to today's
latest (1.2.2-001). Still broken (on W95).
(Review ID: 97498)
======================================================================