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
There are two issues concerning the time difference at hand:
- 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?).
- 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.