Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Timestamp Problem
Hi All,
I have a java.sql.Timestamp object for instance 2002-03-22 17:48:50.659. I get this value out when I use the regular JDK. Now I have an RMI server and print out this Timestamp object by using a toString() on it, and it prints the value just fine.
Now, I pass this object to an applet (The applet calls the RMI server which is printing the right value if I do a System.out and retrieves the same object) and if I do a toString() on it with the same timezone setting it prints the right value too (Note: the Applet client and the RMI server are running on the same machine).
Now if I change the timezone to CST, then the value that is printed by the RMI server is the same (2002-03-22 17:48:50.659), but the value that is printed on the applet if I do a toString on it is different (2002-03-22 19:48:50.659).
I understand that the JRE (I'm using 1.3.1_02, but a lot of JRE's that I tried give the same problem) is trying the manipulate the Timestamp object into the local time, but how come the SDK does'nt do it? I guess that this is a problem with the JRE implementation, but I'm not able to think of any fair way by which I can get around this problem. Is there any way by which I can solve this?
I thank you all in advance for any help that you might extend.
Thanking you again,
Sagar.
Received on Mon Mar 25 2002 - 22:52:15 CST