简体   繁体   English

将日期转换为印度标准时间格式

[英]convert a date into Indian Standard Time format

Technology used: Nodejs, mongo DB, AWS server. 使用的技术:Nodejs,mongo DB,AWS服务器。

I've been trying to achieve this since morning but no success by following some of the references from here and there like link1 , link2 , link3 and this one 从早上开始,我一直在尝试实现这一目标,但通过遵循此处和此处的一些参考,例如link1link2link3和此参考,并没有成功

 var sDate = "2016-02-16T09:22:25.881Z"; var sourceDate = new Date(sDate); alert(sourceDate); 

in the case of basic js this snippet works as I want but in the case of node js this is not converted and returns the value as it is. 在基本js的情况下,此代码段可以按我的要求工作,但在节点js的情况下,则不进行转换并按原样返回值。 Please help me with this. 请帮我解决一下这个。

I recommend you to try Moment-Timezone.js . 我建议您尝试Moment-Timezone.js It is specifically to deal with the Time issues in javascript. 它专门用于处理javascript中的时间问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM