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);
}
}
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
To change your JDJList options, please visit: http://www.sys-con.com/java/list.cfm
