Daylight detection fails in Java 1.1.8
From: work (raja_embedded_at_yahoo.com)
Date: 05/06/04
- Next message: Mike Schilling: "Re: implementing method with different return type"
- Previous message: vg: "Re: Why BufferedReader.read(char[], int, int) blocks?"
- Next in thread: P.Hill: "Re: Daylight detection fails in Java 1.1.8"
- Reply: P.Hill: "Re: Daylight detection fails in Java 1.1.8"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 6 May 2004 11:26:37 +0530
Hi,
When I execute this following program in a windows PC with timezone is set
to GMT + 0 ( London) with automatic adjust for daylight saving enabled, I
get different results for java version 1.1.8 and 1.4.3.
In version 1.1.8 , the useDaylightTime() returns false which is wrong. In
version 1.4.3 , it returns true which is correct.
Similarly the getDisplayName() is not working in 1.1.8 but works in 1.4.3.
Could any body help me in how to achieve correct result for
daylightdetection for this timezone using version 1.1.8.
Here is the sample program.
import java.util.*;
public class timezone{
public static void main(String[] args) {
TimeZone tzone = TimeZone.getDefault();
//String tzn = tzone.getDisplayName(); // Not working
in 1.1.8
//System.out.println(tzn);
if (tzone.useDaylightTime())
System.out.println("Daylight time present");
else
System.out.println("Daylight time absent");
}
}
Thanks/Regards,
Work.
- Next message: Mike Schilling: "Re: implementing method with different return type"
- Previous message: vg: "Re: Why BufferedReader.read(char[], int, int) blocks?"
- Next in thread: P.Hill: "Re: Daylight detection fails in Java 1.1.8"
- Reply: P.Hill: "Re: Daylight detection fails in Java 1.1.8"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|