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?

link|improve this question

67% accept rate
Belongs on superuser.com ? – Paul R Apr 27 '10 at 16:24
1  
@Paul R - Agreed. The OP is trying to use an embedded system, not program one (as far as the question indicates, at least). – Tim Post Apr 28 '10 at 15:18
feedback

migrated from stackoverflow.com Apr 29 '10 at 3:55

This question came from our site for professional and enthusiast programmers.

2 Answers

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.

link|improve this answer
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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.