[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: time zone and UTC issue



On Sat, Dec 01, 2012 at 02:19:50PM +0000, Roger Leigh wrote:
> On Wed, Nov 28, 2012 at 03:55:16PM +0530, J. B wrote:
> > 
> > If I need my hwclock to UTC then what should be the right way to do that ?
> > I have followed "dpkg-reconfigure tzdata" and found it has changed the local time to
> > UTC too. Confused .....
> 
> Just make sure that the date is set correctly (run "date" and set it
> with "date --set="newdate" if it's wrong).  Then run
>   hwclock --utc --systohc
> to set the hardware clock from the system clock in UTC.  Look at
> /etc/adjtime and you should see UTC on the third line.  Use --local
> in place of --utc, and it switches it back to LOCAL.  I'd definitely
> recommend using UTC though.

Just to clear up any confusion regarding your question:

The date command has a --utc option.  Without it, date will
display (or with --set, will set) the system clock in your local
timezone.  But the system clock is still always in UTC; it's
just transparently converting it to (or from, if setting) your
timezone unless you specify the --utc option, in which case no
conversion will take place.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux    http://people.debian.org/~rleigh/
 `. `'   schroot and sbuild  http://alioth.debian.org/projects/buildd-tools
   `-    GPG Public Key      F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800


Reply to: