1

I am in process of updating the Solaris Machine's System Date and Time.... I am using the following command.... Loginned as root........

# date -u 062800002010
Mon Jun 28 00:00:00 GMT 2010
# date
Sun Feb 28 05:30:02 IST 2010

As seen above,, when i fire the "date" command again.... the new updated date doesn't get reflected......... Please let me know on what could be the issue.......

Thanks....

3
  • What says "zdump -v IST" ?
    – jlliagre
    Jun 30, 2010 at 0:02
  • Why aren't you using NTP? If not the NTP daemon, you can set it once using ntpdate. I've not had good luck with the date command either... Mar 17, 2011 at 12:07
  • Are you in the global zone or another zone? Only the global zone should be able to set the system clock since it's shared by all zones.
    – alanc
    Mar 18, 2011 at 2:04

3 Answers 3

2

The hardware clock seems to be broken or not responding to updates. This could be an OS bug or hardware failure.

Add the following lines in /etc/system:

set tod_broken=1
set dosynctodr=0

The tod_broken parameter will prevent the operating system from attempting to update the hardware clock. The dosynctodr parameter, when set to 0 will stop the operating system from syncing its time from the hardware clock.

These can also be set without rebooting using the following commands:

# echo 'tod_broken/W 1' | mdb -kw
# echo 'dosynctodr/W 0' | mdb -kw

I'd also recommend configuring ntpd to keep your time in sync.

0

There is no issue. You are setting UTC date (aka GMT) but are displaying it using a specific timezone that has a 5:30 offset. Where are you located (geographically) ?

4
  • 1
    I don't think the timezone can account for a 4 month difference.
    – pra
    Jun 29, 2010 at 18:52
  • I overlook that detail, probably because the hours are emphasized but not the date. Anyway, nothing forbids to create a bogus timezone which is ~4 month off. Just set its time offset to around -2880 hours and you are set.
    – jlliagre
    Jun 29, 2010 at 23:57
  • I wouldn't say a bogus timezone is a very good solution. It's a cheap hack and it may work for a while but you're gonna run into problems somewhere else. Mar 17, 2011 at 11:32
  • I'm not talking about a solution, just about a possible root cause of the issue.
    – jlliagre
    Mar 17, 2011 at 14:04
0

Look again - he is five months off.

Did you su to root, set the time, then exit back to your original process? I do not understand how you got the displays you show. You are connected to the same machine in both of your examples, correct?

1
  • And I'm six month off to comment your reply ;-) It is easy to reproduce the issue by creating a fake timezone with a -2880 hours offset from GMT.
    – jlliagre
    Dec 30, 2010 at 3:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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