1753479 Members
4771 Online
108794 Solutions
New Discussion юеВ

System Time

 
SOLVED
Go to solution
Steve Valvasori
Advisor

System Time

Our developers wish to push the system clock forward to test an application. Is there anyway from an OS point of view to retrieve a forwarded time? I don't want to actually change the system clock, I just wondered if there is a command or a format of a command that can do this.

Thanks,

Steve.
4 REPLIES 4
Sanjay_6
Honored Contributor

Re: System Time

Hi Steve,

I don't think there is a way other than changing the time manually. Why does your developers want to do that?.

Hope this helps.

Regds
Patrick Wallek
Honored Contributor

Re: System Time

How far forward to they want to set the time? What about creating a custom Timezone in the /usr/lib/tztab file? Then you could 'export TZ=custtz' for the user that is doing the testing.

I don't know if this would work or not, but it may be worth a shot.
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: System Time

No, but it would be a very trivial matter for them to do something like define an env var "TIMEDELTA" and if getenv() returns a non-null value then atoi() the value and add it (it might even be negative) to the epoch seconds returned by the time() system call.
If it ain't broke, I can fix that.
Steve Valvasori
Advisor

Re: System Time

Thanks guys, that's what I thought. To the question 'Why do they want to do that?' - The only answer I can come up with is poor planning on their part. We've talked to them and they are going to change this in the next release, but for now they don't have the time.

Steve.