[ROOT] TDatime and GMT

From: Jon Gans (gans@star.physics.yale.edu)
Date: Thu Dec 06 2001 - 17:05:46 MET


Hello rooters,

 I have a TDatime that is already in GMT and when I call
convert it likes to think its in Eastern time and convert it to GMT
again. I do not want to reconvert times over again, especially
because of the double value problem durring the daylight savings time
switch.

Is there away to have TDatime::Convert() not think its current timezone is
eastern (or the system time zone) and always think its in GMT, without
chaning clocks.  Can eventually a memeber function be added to set
current offset from GMT. Id rather not have to mess with anything gobal
that could cause havoc on other code.


Example:
TDatime jon;
jon.Set(2001,12,6,10,30,30);
jon.AsSQLString() ==> "2001-12-06 10:49:44"
cout << "time = " << jon.Convert() << endl; ==> time = 1007652630

in SQL:
select from_unixtime(1007652630) from Nodes;

+---------------------------+
| from_unixtime(1007652630) |
+---------------------------+
| 2001-12-06 15:30:30       | 


 Thanks alot
 Jon



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:11 MET