Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Changing time zone after installation.

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
cb99
Posts: 15
Joined: 2012-09-03 19:12

Changing time zone after installation.

#1 Post by cb99 »

Hi,

I forgot to change timezone during installation. So I changed it after installation by searching on google. I have dual boot Windows 7 and Debian unstable. I have decided Windows 7 to synchronize time with internet. And debian to use that time. When I noticed I am getting incorrect time, I did following.

Code: Select all

sudo hwclock --systohc --utc

sudo dpkg-reconfigure tzdata

cat /etc/timezone

output is Asia/Kolkata which is correct now.

Then added UTC=yes in /etc/default/rcS

Code: Select all

grep UTC /etc/default/rcS
output is UTC=yes

But when I do

Code: Select all

date
I get

Tue Sep 4 09:01:52 IST 2012

which not correct local time.

I just checked on Windows 7 and it showing me correct time.

kmathern
Posts: 603
Joined: 2011-02-05 19:20

Re: Changing time zone after installation.

#2 Post by kmathern »

In sid & wheezy the UTC variable in the /etc/default/rcS file isn't used anymore, it's now in the /etc/adjtime file.

snippet from `man rcS`

Code: Select all

NOTE 
The EDITMOTD, RAMRUN and UTC variables are no longer used.  ....The UTC setting is replaced by the UTC or LOCAL setting in /etc/adjtime, and should have been migrated  automatically.   See  hwclock(5) and hwclock(8) for further details on configuring the system clock....

User avatar
sunrat
Administrator
Administrator
Posts: 6412
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 462 times

Re: Changing time zone after installation.

#3 Post by sunrat »

Windows expects the hardware clock to be set to local time, Linux expects it to be UTC. There are 2 ways to get the time to show correctly when dual booting with Windows:
- Set the HW clock to local time and tell Linux it is local time using hwclock --localtime command.
- Set the HW clock to UTC and tell Windows it is UTC. This requires editing the registry, see the third reply at https://answers.microsoft.com/en-us/win ... a84fb155d1
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

cb99
Posts: 15
Joined: 2012-09-03 19:12

Re: Changing time zone after installation.

#4 Post by cb99 »

kmathern wrote:In sid & wheezy the UTC variable in the /etc/default/rcS file isn't used anymore, it's now in the /etc/adjtime file.
This helped to fix it. Thank you.

cb99
Posts: 15
Joined: 2012-09-03 19:12

Re: Changing time zone after installation.

#5 Post by cb99 »

sunrat wrote:Windows expects the hardware clock to be set to local time, Linux expects it to be UTC. There are 2 ways to get the time to show correctly when dual booting with Windows:
- Set the HW clock to local time and tell Linux it is local time using hwclock --localtime command.
- Set the HW clock to UTC and tell Windows it is UTC. This requires editing the registry, see the third reply at https://answers.microsoft.com/en-us/win ... a84fb155d1
Thank you already had added registry entries when I was using Arch Linux. I forgot

Code: Select all

 hwclock --localtime
when I switched to Debian.

Thanks for help.

jmbvs
Posts: 1
Joined: 2016-08-17 05:53

Re: Changing time zone after installation.

#6 Post by jmbvs »

About ... dealing with system time set to UTC or not ?

AFAIK most modern OSes expect the system (hardware) clock to be set to UTC. Windows is THE exception... (We all knew that M$ Windows is "exceptional" :-) )

If you are using a Windows system with SP2 or later, I recommend USING UTC as the hardware time, and tell Windows about it. This can be achieved by regedit'ting the key

HKEY_LOCAL_MACHINE\
+--SYSTEM\
+-- CurrentControlSet\
+-- Control\
+-- TimeZoneInformation

and add the value "RealTimeIsUniversal" (DWORD) = 1

Reboot and ... now Windows seems (a bit) better :-)

Have fun

--jmbvs

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Changing time zone after installation.

#7 Post by Head_on_a_Stick »

^ So you've necrobumped a *four year old* thread to repeat the solution given by @sunrat this post?

Oh well done...

*slow handclap*

:roll:
deadbang

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Changing time zone after installation.

#8 Post by GarryRicketson »

by jmbvs » If you are using a Windows system with SP2 or later, I recommend USING UTC as the hardware time, and tell Windows about it.
Who cares any way ? I am not using Windows , and could care less about this,
I thought this forum is about Debian ,

Debian User Forums

Maybe the recent OP "jmbvs" is a "windows bot" that got lost, and does not know where
it is.

Post Reply