How can i change time zone?
-
HI:
I am using qt5 on embedded linux device.
How can i change timezone for date and time manually?
Thanks.
@Yaldiz
If you really want to change the (system) timezone, I don't think Qt libraries offer a call for that. You would need to do it via some other C++/OS-specific system call.If all you want to do is convert datetimes across timezones Qt has QTimeZone Class.
-
Is it possible for me to do this conversion using the QTimeZone class and make it permanent for the application?
@Yaldiz
No, as I said there is nostatic void QTimeZone::setTimeZone()
function.There are C library calls like
tzset()
which work off an (TZ
?) environment variable you could alter. But I do not know which Qt or other libraries calls use that versus a more native timezone OS call.