3

I have an incorrect time in my Ubuntu server, I'm using Ubuntu Server 14.04

When I run date command this is the result:

lun  8 set 2014, 08.28.03, CEST

The correct hour is 10.40.

Teo
  • 380
  • Hmm weird our system is 2 hours off too?! Could be a problem with the time server and not your system :-X – Rinzwind Sep 08 '14 at 08:46
  • If the timezone is correct, and you have a working internet connection, use ntpdate with a known NTP server (like ntp.ubuntu.com) to sync it. – muru Sep 08 '14 at 08:49

2 Answers2

4

This is what solved the issue for me:

check for all timezones, and find yours

timedatectl list-timezones

"America/New_York" matches my zone, so I ran this:

sudo timedatectl set-timezone America/New_York

...Then check the date

date

voilá

DavieFL
  • 41
1

Your hardware clock is probably set to UTC. To verify:
grep UTC /etc/default/rcS

This should give you something like:

# Set UTC=yes if your system clock is set to UTC (GMT), and UTC=no if not.
UTC=no

... with UTC being either yes or no. You probably need to configure this.

Read here how to setup ntpd to always have the correct time.

Jan
  • 12,291
  • 3
  • 32
  • 38
  • I read this guide link and after it I run sudo ntpdate ntp.ubuntu.com and I have the correct hour now.. But I don't understand if my server update the correct hour every day automatically or no.. – Teo Sep 08 '14 at 09:07
  • No, that was a one-time shot. You can add this command to the system crontab so it's executed periodically. – Jan Sep 08 '14 at 09:26