PDA

View Full Version : about QDateTime & timezone



lllturtle
2nd August 2011, 08:14
hi guys,
i got some problem about time ,
i'm using qt 4.7 , i've create a QDateTime dt
and a timer (timeout 60 sec) ,
now i changed the system time zone by outside program ,
and it works ( after set, i got the correct time to correspond time zone ) ,
but when the timer timeout , qt still got the old time ,
( the time zone "t" not changed )
qt not update the time zone immediately , if i close and open it again
qt got the correct time zone .
any function or some way to update time zone immediately ?

below is part of my code :

// In timeout slot , run per minite
QDateTime dt ;
dt = dt.currentDateTime();
QLocale loc ;
QString s = loc.toString(dt,"t yyyy-MM-dd hh:mm") ;
qDebug() << s ;

this problem happened under embedded system , but run well under ubuntu10.04

any advice will be appreciated !! thanks

MarekR22
2nd August 2011, 11:34
IMO you should report a bug.