【问题标题】:CentOS VPS show time same as in India though situated in USCentOS VPS 显示时间与印度相同,但位于美国
【发布时间】:2018-03-06 14:47:15
【问题描述】:

如果现在位于美国的 VPS 显示时间“Mon Sep 25 20:23:56 UTC 2017”, 我在印度的本地机器显示时间“Mon Sep 25 20:25:36 UTC+5:30 2017”(在 VPS 上提前 2 分钟)。

我的问题是当我将date 保存到 mongodb 远程时,它另存为"createdAt" : ISODate("2017-09-25T20:23:56.461Z"),当我在本地机器上看到网站时,时间显示为Tue Sep 26 01:33 UTC 2017。我真的不明白出了什么问题??

为什么在我的本地机器上使用 UTC+5:30?为什么VPS服务器时间和印度标准时间一样?

【问题讨论】:

  • 您在本地计算机和 VPS 上究竟是如何获得时间的?
  • 我的机器设置为 UTC+5:30 TIMEZONE。在 VPS 上它是什么?你到底期待什么?

标签: mongodb meteor momentjs centos7 vps


【解决方案1】:

使用date 命令查看系统时间。
所有服务器都应与 NTP 服务器同步时间以避免此类问题。

yum install ntp
chkconfig ntpd on
ntpdate pool.ntp.org  // You can use ur own NTP server 
service ntpd start

【讨论】:

    猜你喜欢
    • 2021-03-19
    • 1970-01-01
    • 2022-06-29
    • 2020-08-14
    • 2020-08-20
    • 2021-09-22
    • 2010-11-14
    • 2021-06-29
    • 1970-01-01
    相关资源
    最近更新 更多