|
-----Original Message-----
From: Thierry Bernard [mailto:tbernard@informatech.com]
Sent: April 3, 2001 06:59
To: 'JAVA400-L-DIGEST@midrange.com'
Subject: File.setLastModified()// insure an even number of seconds (round down)
long newTime = ficTime - (( (ficTime / 1000) % 2 ) * 1000 );
Date newDate = new Date( newTime) ;
System.out.println( newDate.toString() ) ;
System.out.println( newTime ) ;
aFile.setLastModified( newTime ) ;
$
java -Djava.version=1.2 EvenTime test.txt
Mon Apr 02 19:23:05 GMT+00:00 2001
986239385000
Mon Apr 02 19:23:04 GMT+00:00 2001
986239384000
Thu Jan 01 00:00:00 GMT+00:00 1970
0
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.