We help IT Professionals succeed at work.

Trying to change the system time, but no luck at all..

slajoh01 asked
Medium Priority
Last Modified: 2010-08-05
I have searched in many many places and I think you cannot adjust the time for Solaris 10 x86 on a CDE desktop...THIS IS VERY IMPORTANT TO MY APPLICATIONS FOR LOGGING....So please, will someone please post a reply ASAP? I am using Solaris 10 on Intel and I am using CDE. Ever since DST, my clock is very off by one hour ahead...I am dual-booting with Windows 2000 and because thats the case, is that the problem? Because in Windows, the timezone is set to adjust DST automatically...So, is there any way to adjust the CDE clock in Solaris because I am in a total lost here. I have been in 5 forums, and nobody knows and I searched google and nothing came up. Also searched in Sun.docs pages and nothing about adjusting the system clock in CDE..Is there a command for this?

This is very urgent since all of my apps have to be logged by time.


EDIT>>> No need to reply...I got it working after hours of searching:

Its actually:

# date HHMM

thats it.
Watch Question

system administrator
Top Expert 2007
In Solaris system time is always UTC.
Your system should not ajust system clock, but every program that need local time should use localtime() or similar function calls to get local time (adjusted to UTC)

Your default timezone is located in file /etc/TIMEZONE
where you can find variable like this:

It's a zone file name, relative to /usr/share/lib/zoneinfo dir

Also there where recent patches to Solaris where zoneinfo files where updated according to latest changes (it was in March).

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
while Solaris uses a reliable method to query and adjust date/time, windows relies on the BIOS and also sets the time in the BIOS.
So, if you dual boot, then you have to tell Solaris that the BIOS time is your localtime and not UTC. Simply set in /etc/TIMEZONE:
just add a bit more details to the previous comments.

To change the TIMEZONE for your system:

1.have a look at  a list of the TIMEZONE you can use:
   ls /usr/share/lib/zoneinfo
2. edit /etc/TIMEZONE file, change the TZ variable (I've done this)
  you might need to change the LC_TIME var if required


PS: You can use different timezone for the applications, eg:
define the ENV var TZ in the application user's .profile
Top Expert 2015

No comment has been added to this question in more than 21 days, so it is now classified as abandoned.
I will leave the following recommendation for this question in the Cleanup topic area:

Split between Nopius #16357824 and yuzh #16358573

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

EE Cleanup Volunteer
I guess that my comment is as valuabel is the others, someone disagrees?

I agreed with ahoffmann. Since the system is dual boot
M$ Windows could reset the BIOS time and cause problem.
Top Expert 2015

I cannot agree - the actual system time unlike in other cases in this case will be wrong.
Top Expert 2015

Actually all the dupes should be reduced. Sorry for not noticing.
> ..  the actual system time unlike in other cases in this case will be wrong.
what du you mean?
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.