Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to disable UTC time?

1,129 views
Skip to first unread message

Yuwen Dai

unread,
Jul 8, 2013, 10:30:02 PM7/8/13
to
Dear all,


My BIOS clock is set the time as my local time, debian thinks it's UTC time, so it adds 8 hours because I'm in timezone UTC+8, this is not correct.  I do these actions to disable UTC:

1.  add UTC=no in /etc/init.d/rcS
2. remove UTC , add LOCAL in /etc/adjtime
 
Neither of the above works.  Yesterday  I set the BIOS clock as UTC time, then Linux added 8 hours to it, it's my local time which was correct.  But this morning, the system time in Linux is 8 hours ahead again. 

So how to disable UTC or set the correct clock?  I'm using Debian Wheezy.

Best regards,
Yuwen

Joe Pfeiffer

unread,
Jul 9, 2013, 12:40:02 AM7/9/13
to
I realize this is the sort of answer that annoys me to death when I get
it... but why not fix the time on your BIOS clock?


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/1bvc4kj...@snowball.wb.pfeifferfamily.net

Yuwen Dai

unread,
Jul 9, 2013, 2:40:02 AM7/9/13
to
> I realize this is the sort of answer that annoys me to death when I get
> it... but why not fix the time on your BIOS clock?

I did. As I mentioned in the previous email, I set the BIOS clock as
UTC time and set my time zone as UTC+8, this works. My machine also
has Windows, after I boot into Windows, I found the BIOS clock was
modified by Windows that set the clock time as local time, i.e. UTC+8,
after that I boot into Linux, Linux thinks the BIOS clock is till
UTC, it add 8 hours again to get the local time, so my clock is 8
hours ahead. To get rid of the interference of Windows, I need to
disable UTC.

Best regards,
Yuwen


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/CANdEz-Yx4GtMk_KycJMRYDOw-ktd87SqO-KiTfA5PyLL=vs...@mail.gmail.com

emmanuel segura

unread,
Jul 9, 2013, 2:50:01 AM7/9/13
to
Hello

If you wanna fix the problem = remove windows :)


2013/7/9 Yuwen Dai <yuw...@gmail.com>



--
esta es mi vida e me la vivo hasta que dios quiera

Ralf Mardorf

unread,
Jul 9, 2013, 2:50:02 AM7/9/13
to
On Mon, 2013-07-08 at 22:12 -0600, Joe Pfeiffer wrote:
> Yuwen Dai <yuw...@gmail.com> writes:
>
> > Dear all,
> >
> > My BIOS clock is set the time as my local time, debian thinks it's UTC time,
> > so it adds 8 hours because I'm in timezone UTC+8, this is not correct. I do
> > these actions to disable UTC:
> >
> > 1. add UTC=no in /etc/init.d/rcS

!!!!

/etc/default/rcS
_not_
/etc/init.d/rcS

*?*

> > 2. remove UTC , add LOCAL in /etc/adjtime
> >
> > Neither of the above works. Yesterday I set the BIOS clock as UTC time, then
> > Linux added 8 hours to it, it's my local time which was correct. But this
> > morning, the system time in Linux is 8 hours ahead again.
> >
> > So how to disable UTC or set the correct clock? I'm using Debian Wheezy.
> >
> > Best regards,
> > Yuwen
>
> I realize this is the sort of answer that annoys me to death when I get
> it... but why not fix the time on your BIOS clock?

Then the OP would get the wrong time by the computer e.g. for software
that does run without an OS, for saved BIOS settings.

I use local time too and for Arch Linux ntpdate doesn't set the hardware
clock anymore, so after running ntpdate I run hwclock on Arch, perhaps
this now is needed for Debian too.

My unused Debian install:

[rocketmouse@archlinux avlinux]$ cat etc/init.d/rcS
#! /bin/sh
#
# rcS
#
# Call all S??* scripts in /etc/rcS.d/ in numerical/alphabetical order
#

[rocketmouse@archlinux avlinux]$ ls etc/rcS.d/
README S08hwclockfirst.sh S35mountall.sh
S45mountnfs.sh
S00live-config S10checkroot.sh S36mountall-bootclean.sh
S46mountnfs-bootclean.sh
S02hostname.sh S11hwclock.sh S36udev-mtab
S47lm-sensors
S02mountkernfs.sh S12mtab.sh S37mountoverflowtmp
S48console-screen.sh
S03udev S18ifupdown-clean S38pppd-dns
S49console-setup
S04mountdevsubfs.sh S20module-init-tools S39ifupdown
S50alsa-utils
S05bootlogd S30checkfs.sh S40networking
S55bootmisc.sh
S05keymap.sh S30procps S40pcmciautils
S55urandom
S06keyboard-setup S31hibernate S43portmap
S70x11-common
S07hdparm S34fuse S44nfs-common
S99stop-bootlogd-single

[rocketmouse@archlinux avlinux]$ cat etc/adjtime
0.002664 1363282063 0.000000
1363282063
LOCAL

[rocketmouse@archlinux avlinux]$ cat etc/default/rcS
#
# /etc/default/rcS
#
# Default settings for the scripts in /etc/rcS.d/
#
# For information about these variables see the rcS(5) manual page.
#
# This file belongs to the "initscripts" package.

TMPTIME=0
SULOGIN=no
DELAYLOGIN=no
UTC=no
VERBOSE=no
FSCKFIX=no
RAMRUN=no
RAMLOCK=no


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/1373352346.681.70.camel@archlinux

basti

unread,
Jul 9, 2013, 3:00:03 AM7/9/13
to
Or set Windows to use UTC, don't know if it still works.

Here an example
https://help.ubuntu.com/community/UbuntuTime#Make_Windows_use_UTC

Regards,
Basti


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/51DBB388...@arcor.de

Ralf Mardorf

unread,
Jul 9, 2013, 3:30:02 AM7/9/13
to
On Tue, 2013-07-09 at 14:35 +0800, Yuwen Dai wrote:
> > I realize this is the sort of answer that annoys me to death when I get
> > it... but why not fix the time on your BIOS clock?
>
> I did. As I mentioned in the previous email, I set the BIOS clock as
> UTC time and set my time zone as UTC+8, this works. My machine also
> has Windows, after I boot into Windows, I found the BIOS clock was
> modified by Windows that set the clock time as local time, i.e. UTC+8,
> after that I boot into Linux, Linux thinks the BIOS clock is till
> UTC, it add 8 hours again to get the local time, so my clock is 8
> hours ahead. To get rid of the interference of Windows, I need to
> disable UTC.

Sorry, this mails was received after my last reply.

If you're indeed using Windows too, than set up Windows and Linux to
what ever you prefer, both to local or both to UTC. If BIOS or software
that runs without an OS is unimportant, then UTC might be the better
choice to avoid issues that by theory could happen when using Linux with
local. My hardware clock is set to local time and I never experienced
issues, using Linux everyday for the last ten years.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/1373354820.681.95.camel@archlinux

Ralf Mardorf

unread,
Jul 9, 2013, 3:30:02 AM7/9/13
to
On Tue, 2013-07-09 at 08:54 +0200, basti wrote:
> Or set Windows to use UTC, don't know if it still works.

And what should people do that don't use Windows, but need a correct
local time for software that does run without an OS or who want the
local time for saved BIOS settings?

The OP asked how to use local time by the hwclock and not how to use UTC
with Windows. Does the OP use Windows?

I'm using local time, but I don't care about what ever time settings
Microsoft should prefer. To chose local or UTC time has nothing to do
with Windows, especially when Windows isn't installed.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/1373354418.681.90.camel@archlinux

Yuwen Dai

unread,
Jul 9, 2013, 5:20:01 AM7/9/13
to
On 7/9/13, Ralf Mardorf <ralf.m...@alice-dsl.net> wrote:
> On Mon, 2013-07-08 at 22:12 -0600, Joe Pfeiffer wrote:
>> Yuwen Dai <yuw...@gmail.com> writes:
>>
>> > Dear all,
>> >
>> > My BIOS clock is set the time as my local time, debian thinks it's UTC
>> > time,
>> > so it adds 8 hours because I'm in timezone UTC+8, this is not correct.
>> > I do
>> > these actions to disable UTC:
>> >
>> > 1. add UTC=no in /etc/init.d/rcS
>
> !!!!
>
> /etc/default/rcS
> _not_
> /etc/init.d/rcS
>

Sorry, my typo. I also modify /etc/default/rcS in fact.
The manual of rcS says UTC in rcS is not supported and suggests use
UTCor LOCAL in /etc/adjtime. I tried both UTC=no in rcS and LOCAL in
/etc/adjtime, no effect. And /etc/adjtime seems a dynamically
created file.

Best regards,
Yuwen dai


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/CANdEz-YJwXExXHgRZGz_Bz9i...@mail.gmail.com

Joe Pfeiffer

unread,
Jul 9, 2013, 11:00:02 AM7/9/13
to
Yuwen Dai <yuw...@gmail.com> writes:

>> I realize this is the sort of answer that annoys me to death when I get
>> it... but why not fix the time on your BIOS clock?
>
> I did. As I mentioned in the previous email, I set the BIOS clock as
> UTC time and set my time zone as UTC+8, this works. My machine also
> has Windows, after I boot into Windows, I found the BIOS clock was
> modified by Windows that set the clock time as local time, i.e. UTC+8,
> after that I boot into Linux, Linux thinks the BIOS clock is till
> UTC, it add 8 hours again to get the local time, so my clock is 8
> hours ahead. To get rid of the interference of Windows, I need to
> disable UTC.

Ah, the problem is that Windows is messing with your BIOS. I boot my
laptop into Windows so rarely that just letting the NTP servers change
the time works (so it's a couple of seconds after I go to Windows that I
see local time correctly; likewise, it's a couple of seconds after I go
to Linux before my time is shown correctly). Presumably you've got ntp
installed?

That said, it's supposed to be possible to fix Windows (all versions
since an early update to XP) to use UTC in the BIOS. Here's a link to a
page giving instructions; like I said, I haven't bothered so this is
untested:

http://kb.norsetech.net/set-windows-clock-to-utc-time/
--
"Erwin, have you seen the cat?" -- Mrs. Shroedinger


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/1bobabz...@snowball.wb.pfeifferfamily.net

Kailash Kalyani

unread,
Jul 9, 2013, 11:10:03 AM7/9/13
to
Hi,

Depending on the version of windows you're using you can configure
windows to use UTC time. Here's the archwiki link:
https://wiki.archlinux.org/index.php/Time

Best wishes,
Kailash


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/51DC657D...@gmail.com

Roger Leigh

unread,
Jul 13, 2013, 5:40:02 PM7/13/13
to
On Tue, Jul 09, 2013 at 09:20:18AM +0200, Ralf Mardorf wrote:
> On Tue, 2013-07-09 at 08:54 +0200, basti wrote:
> > Or set Windows to use UTC, don't know if it still works.
>
> And what should people do that don't use Windows, but need a correct
> local time for software that does run without an OS or who want the
> local time for saved BIOS settings?

Having the "correct" [local] time in the BIOS is of dubious value
if you're just booting Linux. It's not like anyone actually looks
at it directly--there's no real need to; the clock is fully
adjustable from within Linux with date/hwclock. Same for any other
OS. What's on the BIOS setup screen is not exactly of great
importance; and UTC here is not wrong in any way. Who on earth is
using software "without an OS". I'm unconvinced that there's a
credible use case there.

> The OP asked how to use local time by the hwclock and not how to use UTC
> with Windows. Does the OP use Windows?

If you /really/ want to configure Linux to use local time, and I'm
not for a moment recommending it, then

sed -i -e 's:^UTC$:LOCAL:' /etc/adjtime

the UTC= parameter in /etc/default/rcS is no longer used; hwclock
now uses the value in /etc/adjtime (this is the only actual use
of this file). If you upgraded to wheezy, the UTC setting will
have been automatically migrated to /etc/adjtime; for a new install
it'll have used /etc/adjtime from the start.

> I'm using local time, but I don't care about what ever time settings
> Microsoft should prefer. To chose local or UTC time has nothing to do
> with Windows, especially when Windows isn't installed.

It's almost always an incorrect choice. If you dual boot, then both
systems will want to do DST adjustments, guaranteeing it will screw up
at least twice per year in all probability, and quite possibly more
than that as the different OSes all try to update the hwclock. But
even if you single boot it's still possible to screw up over DST
changes. UTC is *guaranteed* to be reliable by being simple, monotonic
and avoiding pointless dicking around with the clock. Believe me, I
spent several man days testing hwclock and the init scripts prior to
the release of wheezy including transitioning between every possible
utc/local tz/dst possible. LOCAL does work, just not 100% reliably.
The system knows which timezone you're in, and the system clock is UTC
irrespective of the hardware clock, so there's really no good reason
not to use UTC for the hardware clock.

I dual boot with Windows; I just disabled DST changes and set the
timezone to UTC (in Windows). It would have been nicer to tell it
to use a UTC hardware clock, but I didn't care enough about Windows
to bother configuring that; as suggested before, Windows can be
configured to use a UTC hardware clock if you want to dual boot.


Regards,
Roger

--
.''`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' schroot and sbuild http://alioth.debian.org/projects/buildd-tools
`- GPG Public Key F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/20130713213...@codelibre.net

André Nunes Batista

unread,
Jul 16, 2013, 2:30:01 PM7/16/13
to
Hello again!

Yesterday I did a hardware cleanup and almost attempted suicide when my
pc refused to boot afterwards. Upon solving the issue and having moved
my hd around a bit, there was a complaint error message system saying
something like:

"Error mounting: Previous mount date 15/07/2013 is in the future. Today
is 05/02/2013"

and gave me console to solve. I tried fsck once and it asked me if I
would like to correct issue. Since it did not inform what solution would
be applied, I went to bios and manually set up bios date (the Feb one).
Then debian booted with no complaints.

Am I missing something? Is there a way to tell the kernel to ignore bios
date? I know, my question is a different one, but it was raised when you
said bios date has no value on pure linux.

--

Luther Blisset
GNUPG/PGP KEY: 6722CF80

I challenge you to play the game in which there is no loser but
everything is fun and worthwhile!



signature.asc

Ralf Mardorf

unread,
Jul 16, 2013, 2:40:01 PM7/16/13
to
On Tue, 16 Jul 2013 20:27:08 +0200, André Nunes Batista
<andren...@gmail.com> wrote:

> Hello again!
>
> Yesterday I did a hardware cleanup and almost attempted suicide when my
> pc refused to boot afterwards. Upon solving the issue and having moved
> my hd around a bit, there was a complaint error message system saying
> something like:
>
> "Error mounting: Previous mount date 15/07/2013 is in the future. Today
> is 05/02/2013"
>
> and gave me console to solve. I tried fsck once and it asked me if I
> would like to correct issue. Since it did not inform what solution would
> be applied, I went to bios and manually set up bios date (the Feb one).
> Then debian booted with no complaints.
>
> Am I missing something? Is there a way to tell the kernel to ignore bios
> date? I know, my question is a different one, but it was raised when you
> said bios date has no value on pure linux.
>

Next time run fsck, after that you're able to boot. I never noticed that
it changed anything, but seemingly the former mount date. I very seldom
experienced this after making a new install, perhaps when the installer
ignored the wanted setting.

It's true, Linux is independent from the BIOS time when you use UTC
instead of local. I want local time for the BIOS regarding to my needs.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/op.w0bvarkoqhadp0@suse11-2
0 new messages