File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Offsetting systime Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Offsetting systime" Watch "Offsetting systime" New topic

Offsetting systime

Mahesh Mamani
Ranch Hand

Joined: Jun 25, 2001
Posts: 110
Hi All,
I'm retrieving the systime using the Date class and offsetting it to SGT using SinpleTimeZone. The code works fine in Java 1.1.7 environment but fails on the Java 1.1.3 environ.
SimpleTimeZone stz = new SimpleTimeZone(+8*60*60*1000,"Asia/Singapore");
formatter = new SimpleDateFormat("ddMMMyyyy hh:mm:ss a");
Date date = new Date();
StringBuffer timeStampBuff = new StringBuffer();
Is this a known bug or something which I have missed out.
Thanks in advance,
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
Are you SERIOUSLY trying to use the 1.1.3 jdk? Or did you mean the 1.3.1 jdk?

"JavaRanch, where the deer and the Certified play" - David O'Meara
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
This looks like the bug that you are running into:
Bug Id 4065244

Votes 6

Synopsis TimeZone NightMare.... The movie...

Category java:classes_util

Reported Against 1.1.1, 1.1.3

Release Fixed

State Closed, duplicate of 4069784

Related Bugs

Submit Date Jul 16, 1997

We are currently coding an application using timezone
and I have some problem with the time zone return by java.util.Date
On Solarix 2.5.1, if I do a

import java.util.Date;
class tt
public static void main(String args[])
throws java.text.ParseException
Date d;
d = new Date();
double tz;
tz = d.getTimezoneOffset();
System.out.println(tz+" mins");
System.out.println((tz/60.0)+" hours\n");

This threads to several other Bugs that more closely resemble yours. Sign on to Sun and read all about it. .
[ August 20, 2002: Message edited by: Cindy Glass ]
I agree. Here's the link:
subject: Offsetting systime
It's not a secret anymore!