[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: QDateTime -> time_t ??
From:       Nicolas Goutte <nicog () snafu ! de>
Date:       2002-08-20 12:58:34
[Download RAW message or body]

As expected! Your experience is exactly what I meant when I have written that 
I had fallen into the trap.

As I have written, QDateTime::setTime_t is local time (therefore UTC+2 in 
summer), not UTC. However, the time that you have to check is UTC, isn't it?

The 1 hour difference with setTime_t is because it is forgetting the summer 
time. I am going to bug TrollTech.

Have a nice day/evening/night!

On Dienstag, 20. August 2002 14:34, Michael Goffioul wrote:
> > Nope, but you could try
> >
> > QDateTime theTimeIWantToConvertToTimeT;
> > QDateTime epoch;
> > epoch.setTime_t(0);
> > time_t t = epoch.secsTo(theTimeIWantToConvertToTimeT);
>
> My first try was
>
> QDateTime(QDate(1970,1,1),QTime(0,0,0)).secsTo(myTime)
>
> but I got 2 hours shift. Your solution gives me 1 hour shift. Note
> that my timezone in Europe/Brussels.
>
> Michael.

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic