I'm trying to set the time in an embedded system ...
There isn't a link/file /etc/localtime and /usr/ has only two subdirectories /usr/bin and /usr/sbin.
Is there something I can try or do I just give up and make UTC be my timezone?
|
I'm trying to set the time in an embedded system ... There isn't a link/file Is there something I can try or do I just give up and make UTC be my timezone?
| |||||||
feedback
|
This question came from our site for professional and enthusiast programmers.
|
You can probably just set TZ, something like : TZ=":America/New_York" and then any time conversion function is going to make a call to tzset() that will help it get the right time (Atleast the man page of tzset says so). You can do the same too, if you are writing an application that needs time information. Don't take my word for it ;) I am just saying what the man page says. You should go check it out yourself. | |||
|
feedback
|
|
Try setting the TZ environment variable in /etc/profile to something that looks like TZ=EST5EDT for 5 hour offset from UTC if your location doesn't do daylight savings just give it a timezone code & UTC offset. for example India Std Time would be TZ=IST-5:30 the TZ environment variable is a posix standard you can read more about it. http://www.gnu.org/s/libc/manual/html_node/TZ-Variable.html | |||
|
feedback
|