Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
462 views
in Technique[技术] by (71.8m points)

shell - synchronize local Debian time with amazon Debian instances (RDS) MDT to UTC

it tried this command on my amazon Debian instances

    root@ip-:~# date
    Sun Apr 27 11:26:34 UTC 2014

and in my local debain instances its like this

  root@debian:~# date
  Sun Apr 27 16:56:56 MDT 2014

so now how can i make my local debain machine time as same as the amazon instance time

i.e

convert

   Sun Apr 27 16:56:56 MDT 2014 ->(to) Sun Apr 27 11:26:34 UTC 2014 this

in my local debain machinee

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

There are two issues concerning the time difference at hand:

  1. Timezone - your local Debian system is running with your local timezone, whereas the EC2 instance is running with Coordinated Universal Time (UTC). The latter is pretty much the norm and resp. best practice for servers, you can adjust your local system via sudo dpkg-reconfigure tzdata (see Ynhockey's answer to How do I permanently reset the time zone in Debian?).
  2. Precision - either one or both of your systems exhibit significant clock skew against UTC (both times should be identically after subtracting the timezone offset). This is easily remedied by installing a Network Time Protocol (NTP) daemon to Set the time automatically as explained in Debian's DateTime, which boils down to sudo apt-get install ntp and editing /etc/ntp.conf to target more local NTP server sources for optimal results.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...