Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

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

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

2 Answers 2

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.

share|improve this answer

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

share|improve this answer
    
Better to use /etc/environment, I think - files like /etc/profile are usually not parsed until and unless for a shell, like bash etc. It is better to use the environment file because that sets up the timezone for all system processes, not just those started by the shell, and which I think should also know about the timezone being specified. –  amn Apr 14 at 9:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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