Change from UTC time back to local time?

Somehow, and I don’t know how, the clock on my openSUSE 12.1 KDE system has changed to UTC time.

I don’t know how it happened or why.

I found online this suggestion which I tried, but it didn’t do anything

Linux Tips - Linux, Clocks, and Time
Setting UTC or local time

When Linux boots, one of the initialisation scripts will run the /sbin/hwclock program to copy the current hardware clock time to the system clock. hwclock will assume the hardware clock is set to local time unless it is run with the --utc switch. Rather than editing the startup script, under Red Hat Linux you should edit the /etc/sysconfig/clock file and change the UTC'' line to either UTC=true’’ or ``UTC=false’’ as appropriate.

I have also looked into “Adjust Date and Time” and “Digital Clock Settings” but nothing struck me as what it was I needed to change.

I’ll admit, I was hoping for a “Show UTC” or something like that with a checkbox but I haven’t seen one yet.

On 2012-03-11 01:46, dragonbite wrote:
>
> Somehow, and I don’t know how, the clock on my openSUSE 12.1 KDE system
> has changed to UTC time.

Do you mean that the KDE clock applet is displaying time as UTC? Well, just
tell the applet to display it in the timezone you prefer, but do not
attempt to change the clock.

Or do you mean that the system clock is incorrect? How do you know?
No, KDE is not acceptable as proof :slight_smile:
I only accept command line commands and output.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Adjusting the hardware clock is done In Yast. KDE clock is only to adjust time for the user. If you dual boot with Windows it is probably best to set the hardware clock to local time since Windows expects that by default.

I have exactly the same problem as drgonbite. I do not run windows, I only have OpenSUSE running and the clock is set to UTC time. I have used the settings to try and change it but nothing works.
Any help appreciated.

I think there is some misunderstandfing here about the several expressions used.

. In Unix/Linux the system clock runa allways aat UTC (when not you are asking for problems).

. At shutdown, the sytem clock stores the time in the hardware clock of the PC, it normaly does so also in UTC, but when you multi boot with Windows, you better store the local time in the hradware clock because Windows has a cpmplete different look at those things. This setting is in in YaST. At boot, the system clock is first set from the hardware clock and again it knows from the setting if it has too ajust
from a local time hardware clock to an UTC system clock or it it can use the hardware clock withoutr adjusting.

. Because these hardware clocks are not allways that precise in keeping time in a power downed system (they use the CMOS battery), a system manager normaly makes the system an NTP client to correct the system clock direct after boot and then during the tim the system is up.

. Every process can have a environment variable that tells it in which time zone this process should interprete time. There is such a timezone for the system itself. Thus most proceesses (and root procecces) started without further specification use this setting. It s normaly set to the time zone the system is physicaly. It is set at iinstallation and changeble using YaST.

. Every user can set his own time zone (after all, users can log in in a system from everywhere in the world and of course want to see time in there own time zone, not the time zone of the system or of another user). For a KDE user there is the KDE configuration tool to do this.

Thus, when you want to reposrt a problem with a clock setting, we need to know which one is wrong in your opinion and also which one is correct. Like said above allready, we need CLI output to come to any conclusion. Thus e.g. as root you do

date]

and tell us what you wall clock or watch shows.
And the same for a user (if there is a user that complains).

And to check what the configuration is:

cat /etc/sysconfig/clock

I was having the same problem after upgrading to 4.8.1 from .8.0 . Yes, i do dual boot(but don’t use windozzz$$$). The solution was quite simple. As gogalthorp already suggested you need to change it from YaST. Open YaST and go to Date & Time and uncheck ‘Hardware clock set to UTC’. That would done it. At least it worked for me.

Thank you for the replies! My Hardware clock set to UTC was already unchecked. Yet in my task bar it clearly states that it is using UTC! It is really puzzling.
I have put the output of the CLI commands below:-
linux-0u5w:~ # date]
If ‘date]’ is not a typo you can use command-not-found to lookup the package that contains it, like this:
cnf date]

linux-0u5w:~ # cat /etc/sysconfig/clock

Path: System/Environment/Clock

Description: Information about your timezone and time

Type: string(-u,–utc,–localtime)

ServiceRestart: boot.clock

Command: /sbin/refresh_initrd

Set to “-u” if your system clock is set to UTC, and to “–localtime”

if your clock runs that way.

HWCLOCK="–localtime"

Description: Write back system time to the hardware clock

Type: list(yes,no,)

Is set to “yes” write back the system time to the hardware

clock at reboot or shutdown. Usefull if hardware clock is

much more inaccurate than system clock. Set to “no” if

system time does it wrong due e.g. missed timer interrupts.

If set to “no” the hardware clock adjust feature is also

skipped because it is rather useless without writing back

the system time to the hardware clock.

Note that you need to enable boot.clock for this feature to take

effect.

defaults to ‘yes’ if unset

SYSTOHC=""

Type: string(Europe/Berlin,Europe/London,Europe/Paris)

ServiceRestart: boot.clock

Command: /sbin/refresh_initrd

Timezone (e.g. CET or Asia/Tokyo). The value should correspond

to the contents of the /etc/localtime file and is for internal

YaST use; changing this setting will not make SuSEconfig update

the /etc/localtime file, YaST does that or you will need to do

this manually by calling zic -l.

TIMEZONE=“Australia/Melbourne”
DEFAULT_TIMEZONE=“US/Eastern”

I appreciate the help that is being provided.

Hm, that should of course be

date

my typo.

But you should of course post any computer text between CODE tags: http://forums.opensuse.org/english/information-new-users/advanced-how-faq-read-only/451526-posting-code-tags-guide.html

You seem to have configured Australia/Melbourne as your system time zone. Thus the output of date sshould correspond with that.

On 2012-03-11 13:56, ningbojoe wrote:
>
> Thank you for the replies! My Hardware clock set to UTC was already
> unchecked. Yet in my task bar it clearly states that it is using UTC! It
> is really puzzling.

Read again what Henk posted.
Whether you set in YaST the hardware clock to UTC or not, this is
absolutely and completely unrelated to the taskbar displaying UTC or any
other timezone.

Please don’t confuse things, and clarify where exactly you want to use UTC
or not. If it is KDE, it is uniquely a KDE issue, do not touch YaST, or you
will break things further.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

On 2012-03-11 12:56, hcvv wrote:
>
> I think there is some misunderstandfing here about the several
> expressions used.

Indeed! :slight_smile:

> In Unix/Linux the system clock runa allways aat UTC (when not you are
> asking for problems).

To clarify a bit: Linux internally always runs UTC and this can not be
changed at all.

To be a bit pedantic, time is actually kept as seconds counted
since the UTC midnight of 1970-01-01
(<http://en.wikipedia.org/wiki/Unix_epoch>)

The local/utc setting only applies to the battery kept cmos clock that runs
when the system is not powered, and copied to the system clock when it boots.

And, as you say, every process or user can choose what time it uses. Or
rather, what time it displays, internal clock remains UTC.

Thus whether KDE displays UTC or one flavour of local time is totally
unrelated to the cmos clock setting “utc/local”. And also independent of
what other desktops or programs show.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Thank you for the replies. I have tried to change my display clock by using the KDE System Settings! UTC is unchecked, the time and date displayed in the System Settings are correct for my Time Zone. What is not correct is the clock on the bottom panel. It displays the UTC time currently showing 02:43AM when the actual time is 01:43PM.
Thanks for trying to help!

My system confuses me.

It was showing UTC time, or at least I assume it did because it said “UTC” in the digital clock, and the time was about the right number of hours off.

I did the change to the /etc/sysconfig/clock but it didn’t do anything in the first couple times I booted up.

Now tonight, after booting from the Windows 7 hard drive (completely separate hard drive) when I booted into openSUSE the time was correct, but it still showed UTC for the timezone.

I unchecked the include timezone option in the digital clock settings and made sure my timezone is also checked (New York).

I’m not sure what exactly happened, though.