To change your JDJList options, please visit: http://www.sys-con.com/java/list.cfm-----Original Message-----
From: LASSEHAB,HICHAM (Non-HP-France,ex2) [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 27, 2002 1:34 PM
To: JDJList
Subject: [jdjlist] RE: Using different time zones in jdk1.1.8Hi,I know that there are many problems with the Time Zone under java1.1, You could therefore construct your own TZ variable that starts with ECT ie (TZ=ECT-1ECTDST)You can look this exemple:
$ cat CalendarUse2.java
import java.util.*;
import java.text.*;
import java.awt.Graphics;
import java.applet.*;
public class CalendarUse2 extends Applet {
public void paint(Graphics g) {
// Use short 3 letter code for compatibility with java 1.1.
// However note that as mentioned in the current Java API
// documentation their use is deprecated.
TimeZone tz=TimeZone.getTimeZone("ECT");
Calendar calendar =Calendar.getInstance(tz);
DateFormat df = DateFormat.getDateTimeInstance(DateFormat.FULL,DateFormat.FULL,Locale.FRENCH);
df.setCalendar(calendar);
Date d= calendar.getTime();
g.drawString(df.format(d),25,25);
}
}
Hope this help you
Hicham Lassehab
**** / /__ ____ **** mail
*** / __ )/ __ ) *** [EMAIL PROTECTED]-----Original Message-----
From: Ron Sher [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 27, 2002 2:05 PM
To: JDJList
Subject: [jdjlist] Using different time zones in jdk1.1.8Hi all,I'm trying helplessly to change the default time zone (in order to get read of inconsistencies in daylight saving time) under JDK1.1.8.I'm using setTimeZone() to do that. It works fine under JDK1.2, but seems not to do the effect in JDK1.1.8.When I'm using the calendar's get(Calendar.HOUR) it returns the same thing regardless of the time zone I created.Any ideas?thanks,Ron SherTo change your JDJList options, please visit: http://www.sys-con.com/java/list.cfm
I think I've
managed to solve my problem.
It seems that
in JDK 1.1.8 using setTimeZone() after the calendar was created has no affect.
Therefore I've used Calendar.getInstance(zone) and new Calendar(zone) and it
seems to be working.
Thanks,
Ron
- [jdjlist] RE: Using different time zon... LASSEHAB,HICHAM (Non-HP-France,ex2)
- Ron Sher
