LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 04-07-2017, 01:50 PM   #1
trumpforprez
Member
 
Registered: Nov 2016
Location: UK
Distribution: Debian Jessie
Posts: 154

Rep: Reputation: Disabled
Changing system time on Debian


The clocks have gone back one hour in the UK and so the system time on the OS is an hour ahead.

I'm using the xfce desktop and it's not very slick at changing the time.

So what is the command to change the system time from the terminal? Thanks in advance.
 
Old 04-07-2017, 03:01 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,698

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
You can manually set the date/time using the date command i.e.

date -s "7 APR 2017 18:00:00"

Normally, assuming your tz database and timezone is configured correctly the clock should automatically adjust for daylight saving time.

Gone back? Didn't time switch Sunday, March 26, 2017 which moved an hour forward. So your system time should be an hour behind.

Last edited by michaelk; 04-07-2017 at 03:04 PM.
 
Old 04-07-2017, 03:55 PM   #3
trumpforprez
Member
 
Registered: Nov 2016
Location: UK
Distribution: Debian Jessie
Posts: 154

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
You can manually set the date/time using the date command i.e.

date -s "7 APR 2017 18:00:00"
Thank you for your reply.
I was looking for some kind of automatic time changing thing which takes account of British Summer Time (BST).

Quote:
Normally, assuming your tz database and timezone is configured correctly the clock should automatically adjust for daylight saving time.
Yes, this is what I was expecting.
I am wondering if Debian-users have experienced this on their OS if their country has a similar 'daylight saving time' procedure?

Also, there must be a method of taking 'system time' from some reputable internet source (e.g. UK.gov).
Is there a command to take 'system time' from a specific UK website?

Quote:
Gone back? Didn't time switch Sunday, March 26, 2017 which moved an hour forward. So your system time should be an hour behind.
Yes, this is a little confusing, but my system time is actually 1 hour ahead.
Is there some way of finding out where the problem lies?
During install, I'm pretty certain I gave the right info to choose the correct timezone.
 
Old 04-07-2017, 03:58 PM   #4
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
You should set up NTP, it will keep your time synchronized.
 
Old 04-07-2017, 04:16 PM   #5
trumpforprez
Member
 
Registered: Nov 2016
Location: UK
Distribution: Debian Jessie
Posts: 154

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Emerson View Post
You should set up NTP, it will keep your time synchronized.
Yes, but isn't there a way of getting Debian to just tell the time without getting hacked?

Have you set up NTP on your system?
 
Old 04-07-2017, 04:19 PM   #6
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
I run NTP server in my router, which gets the time from net and serves to all devices on LAN.
 
Old 04-07-2017, 04:26 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,698

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
ntp will keep the the system clock synchronized but it has nothing to do with time zones or DST changing.

The system clock and ntp are referenced to UTC.
 
Old 04-07-2017, 04:30 PM   #8
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by trumpforprez View Post
During install, I'm pretty certain I gave the right info to choose the correct timezone.
Just to be sure use dpkg-reconfigure tzdata to run its setup again making sure you have chosen the correct option. The time always has changed correctly here in the many years I have used Debian. Also you have made sure the BIOS time is set correctly?
 
Old 04-07-2017, 04:41 PM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,698

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
The output will display the timezone setting showing when DST switch over occurs.

zdump -v /etc/localtime | grep 2017

Shows what timezone is selected.
cat /etc/timezone

Last edited by michaelk; 04-07-2017 at 04:45 PM.
 
Old 04-07-2017, 07:04 PM   #10
trumpforprez
Member
 
Registered: Nov 2016
Location: UK
Distribution: Debian Jessie
Posts: 154

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by HappyTux View Post
Just to be sure use dpkg-reconfigure tzdata to run its setup again making sure you have chosen the correct option.
I have already done this. I expected it to resolve the problem.
However, the system time is still +1 hour to BST in the UK.
Don't know why this is happening.

Quote:
Also you have made sure the BIOS time is set correctly?
Never had a problem with the time before. So I'm guessing BIOS time is ok.
 
Old 04-07-2017, 07:11 PM   #11
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
You can use hwclock to check and change BIOS time.
 
1 members found this post helpful.
Old 04-07-2017, 07:20 PM   #12
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,698

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Its possible that your system thinks the BIOS is UTC but really configured for local time. You may not of noticed since your only +1 offset from UTC.

The configuration file /etc/adjtime last line should be either local or UTC. With the hwclock command you can check the BIOS clock to see.
 
Old 04-08-2017, 01:27 PM   #13
trumpforprez
Member
 
Registered: Nov 2016
Location: UK
Distribution: Debian Jessie
Posts: 154

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
The output will display the timezone setting showing when DST switch over occurs.

zdump -v /etc/localtime | grep 2017
I have done this and the output is:
Code:
# zdump -v /etc/localtime | grep 2017
/etc/localtime  Sun Mar 26 00:59:59 2017 UT = Sun Mar 26 00:59:59 2017 GMT isdst=0 gmtoff=0
/etc/localtime  Sun Mar 26 01:00:00 2017 UT = Sun Mar 26 02:00:00 2017 BST isdst=1 gmtoff=3600
/etc/localtime  Sun Oct 29 00:59:59 2017 UT = Sun Oct 29 01:59:59 2017 BST isdst=1 gmtoff=3600
/etc/localtime  Sun Oct 29 01:00:00 2017 UT = Sun Oct 29 01:00:00 2017 GMT isdst=0 gmtoff=0
This seems to be telling me when daylight saving time (DST) begins and ends. This is also known as British Summer Time (BST).
BST is shown on the output.
This is a good command to know.

Quote:
Shows what timezone is selected.
cat /etc/timezone
The output is:
Code:
# cat /etc/timezone
Europe/London
So it looks like I've chosen the correct timezone.
 
Old 04-08-2017, 01:40 PM   #14
trumpforprez
Member
 
Registered: Nov 2016
Location: UK
Distribution: Debian Jessie
Posts: 154

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Emerson View Post
You can use hwclock to check and change BIOS time.
I have run 'hwclock' on the terminal.
It shows that the system time is 1 hour too far.

I need the Debian OS to simply show the same time as the country I live in.

Does anyone know?
 
Old 04-08-2017, 01:42 PM   #15
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
So use hwclock to set right time?
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
System Time keeps changing back and forth jr8rdt Red Hat 5 04-16-2007 01:11 PM
changing the time in the system tray alejan74 General 1 06-30-2005 07:55 PM
Changing system date and time from KDE yapp Linux - General 4 04-17-2005 03:40 AM
Changing System Time rjshirts Linux - Software 4 01-24-2005 03:48 PM
Changing system time on FreeBSD 4.8 tmakobu *BSD 5 03-31-2004 07:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 05:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration