Hi Jon, I've added a default boolean argument toGMT in Convert() which, when set to true, allows you to get a time_t value in GMT. In you example call now jon.Convert(kTRUE). Cheers, Fons. On Thursday 06 December 2001 17:05, Jon Gans wrote: > 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 -- Org: CERN, European Laboratory for Particle Physics. Mail: 1211 Geneve 23, Switzerland E-Mail: Fons.Rademakers@cern.ch Phone: +41 22 7679248 WWW: http://root.cern.ch/~rdm/ Fax: +41 22 7679480
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:11 MET