Set timezone in linux
Is there any function I can use to set the timezone of the entire system in linux using C? (Other than creating a symbolic link between /etc/localtime and /usr/share/zoneinfo/). Could I specify the timezone offset in seconds by any chance?
Thanks in advance!
> Is there any function I can use to set the timezone of the entire system in linux using C?
Have you ever seen timestamps screwed up by daylight savings time corrections?
There is settimeofday(), but you need to be root to call it.
settimeofday(2): get/set time - Linux man page
You might want to consider whether your local convenience is at the expense of a system wide headache.
Basically, I just started interning at this company that makes video conferencing devices. And I need to write a function which sets the time zone of the device, based on this struct that is passed to the function (the struct contains the timezone), so that the device can display the time in local time I guess.
It says on the site that 'The use of the timezone structure is obsolete', and so I was wondering if there is any other function that does that.
Thanks for your help, I appreciate it.
Scroll to the bottom, and click through the "see also" links.