0

If right now VPS situated in US shows time "Mon Sep 25 20:23:56 UTC 2017", my local machine in India show time "Mon Sep 25 20:25:36 UTC+5:30 2017"(appx 2 minutes early on VPS).

My problem is When I save date to mongodb remote it save as "createdAt" : ISODate("2017-09-25T20:23:56.461Z") and when I see website on my local machine the time shows Tue Sep 26 01:33 UTC 2017. I seriously don't understand what is wrong??

why UTC+5:30 on my local machine? and how come the VPS server time is same as Indian Standard time?

Ankur Soni
  • 5,725
  • 5
  • 50
  • 81

1 Answers1

0

Check the system time with date command.
All the servers should sync time with NTP server to avoid this kind of issues.

yum install ntp
chkconfig ntpd on
ntpdate pool.ntp.org  // You can use ur own NTP server 
service ntpd start
Ajay
  • 2,483
  • 2
  • 16
  • 27