[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
Ubuntu-cy - Ubuntu Linux - Cyprus Local Community Team • View topic - Fix date and time in Ubuntu

Fix date and time in Ubuntu

everything for the beginners...

Fix date and time in Ubuntu

Postby marinos » Mon Sep 08, 2008 10:50 am

After some test I done on my Ubuntu server I Realized that date and time were not correct so I received reports in wrong date and time. I apply the following resolutions over commandline. Here is the resolution:

1. In Linux, set the date and time to what it currently is. For example if it’s 10:20am local time:
user@server:~$ sudo date -s 10:20

2. Then update the hardware clock accordingly, and force this to be considered “localtime”:
user@server:~$ sudo /sbin/hwclock --systohc --localtime

3. Check to make sure it looks right:
user@server:~$ sudo /sbin/hwclock --localtime

4. Sync between hardware clock and system clock:
user@server:~$ sudo /sbin/hwclock --hctosys --localtime

Cheers...
Everything should be made as simple as possible, but not simpler.
--Albert Einstein--
User avatar
marinos
How much time you spend in here?
 
Posts: 834
Joined: Tue May 20, 2008 2:37 pm
Location: Limassol

Re: Fix date and time in Ubuntu

Postby theo » Mon Sep 08, 2008 12:54 pm

Some people like to look out of the window. Some others prefer to look at the curtains instead!

www.theo-andreou.org
User avatar
theo
31337 Guru
 
Posts: 3138
Joined: Tue May 06, 2008 10:10 am
Location: Paphos

Re: Fix date and time in Ubuntu

Postby marstop » Tue Sep 09, 2008 10:58 am

Are you sure your timezone is correct ? From what I know most debian distros have ntp enabled by default and point to :
NTPSERVERS="0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org"

Once you fix your GMT settings you should be in the clear with auto time correction :)
marstop
Forum Active member
 
Posts: 93
Joined: Wed May 07, 2008 1:08 pm


Return to newbie

Who is online

Users browsing this forum: Google [Bot] and 0 guests

cron