[英]AWS EC2 UTC timezone conversion off by a day with moment JS
Yesterday I posted this question about MongoDB UTC record timestamp issues when using MomentJS
: 昨天我发布了有关使用MomentJS
时MongoDB UTC记录时间戳记问题的问题:
MomentJS not converting date correctly MomentJS无法正确转换日期
Blakes Seven's answer solved the issue locally, but when I deployed to AWS EC2, the problem reoccurred. Blakes Seven的答案在本地解决了该问题,但是当我部署到AWS EC2时,该问题再次发生。 Here are the steps I took to understand the issue: 这是我为了解问题所采取的步骤:
zip
from S3 bucket. 我验证了Elastic Beanstalk实例是否使用了S3存储桶中的正确zip
。 So the code fix is definitely live. 因此,代码修复肯定是实时的。 US East (N. Virginia)
EC2位置: US East (N. Virginia)
October 21, 2015 at 4:51:31 PM UTC-4 (2684 hours)
: I can't find the actual time zone config of my EC2, but this tells me it's UTC. 发布时间: October 21, 2015 at 4:51:31 PM UTC-4 (2684 hours)
:我找不到EC2的实际时区配置,但这告诉我它是UTC。 So my questions are: 所以我的问题是:
UTC
time 如何验证我的EC2已设置为UTC
时间 I have a simular issue. 我有一个类似的问题。 Everything was going fine with moment.locale('fr')
but wen wrong on AWS EBS/EC2. 使用moment.locale('fr')
一切都很好,但是在AWS EBS / EC2上却出错。 I solved it by using moment-timezone
and force to 'Europe/Paris': moment.tz('Europe/Paris')
我通过使用moment-timezone
并强制使用“ Europe / Paris”解决了这一问题: moment.tz('Europe/Paris')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.