[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
Page 1 of 1

Fix date and time in Ubuntu

PostPosted: Mon Sep 08, 2008 10:50 am
by marinos
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


Re: Fix date and time in Ubuntu

PostPosted: Mon Sep 08, 2008 12:54 pm
by theo

Re: Fix date and time in Ubuntu

PostPosted: Tue Sep 09, 2008 10:58 am
by marstop
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 :)