hour modification

Apr 26, 2010 at 4:20pm
Hello,

I need to know if there is a function to modify the hour or the time zone only for the developped application not for all the system (by setting TZ environment).

For exemple, if system hour is 11a.m I need that my application have 12a.m, without affecting other process.

Thak you in advance
Apr 26, 2010 at 5:01pm
I´m not sure I understand... May You explain to us what you are trying to do?(Maybe this makes it more clear)...
Apr 27, 2010 at 8:41am
Hi,

I'm trying to modify the time of one application without setting the environment time or time zone.

exemple (environment time is GMT, my application time GMT + 2 )

Thank you
Apr 27, 2010 at 11:29am
I'm trying to modify the time of one application without setting the environment time or time zone.

"setenv" on the TZ variable and a call to "tzset" afterwards. It should only change your applications environment setting.

But remember: Everything like this is non-standard C. Don't even think the word "platform independend". ;)


Ciao, Imi.
Apr 27, 2010 at 1:50pm
Thank you Imi, but a call of setenv(TZ,CET,1) will change all the environment : when I execute date command, it show me the new TimeZone.
The call of tzset will not unset this new value on the evironment, isn't it?
Apr 27, 2010 at 1:59pm
hm.. guess then you can prepare to roll your own timezone stuff. :-(

What libc, platform, compiler etc. are you using? Maybe ask in a more specific forum for your environment?

Ciao, Imi.
Topic archived. No new replies allowed.