Skip to Content.
Sympa Menu

freetds - BUG: Local Zone Timestamp - FIX

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: joel_trunick AT dell.com
  • To: freetds
  • Subject: BUG: Local Zone Timestamp - FIX
  • Date: Wed, 28 Apr 1999 18:41:16


Greg,

I didn't seem to get a response to the following posts. Could you make a
comment as to the appopriateness of these posts?

Thanks,
Joel


-----------------------------------------------------
Here is the fix for correcting the Java client from converting timestamps
to GMT. Could this be added to the FreeTDS driver?

Thanks,
Joel Trunick
Dell Computer

GregorianCalendar cal = new GregorianCalendar();
int offset = cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET);

ts = new Timestamp( ts.getTime() - offset );

----------------------------------------------------
I noticed the JDBC 2.0 specification allows you do a
TimeZone.setDefault("your time zone") and you can expect getTimestamp to
return an appropriate Date/Timestamp.

Specs are at
http://java.sun.com/products/jdk/1.2/docs/guide/jdbc/index.html

Joel





Archive powered by MHonArc 2.6.24.

Top of Page