Hi,
I need to get timeoffset from UTC, but got problem getting current timezone. I use the code below. Anyone know how to do it?
BTW, using the same code on Linux works just perfect. Oh and I am sure the timezone is set correctly on android, I set it manually.
QDateTime UTC(QDateTime::currentDateTimeUtc());
QDateTime local(UTC.toLocalTime());
qDebug()<<UTC.toLocalTime().toString("yyyy-MM-dd hh:mm:ss");
qDebug()<<local.timeZone();
double offset = local.timeZone().standardTimeOffset(local); //offset=0
↧