如何在 JavaScript 中使用时区字符串将日期时间转换为本地日期时间?
我想将给定的日期时间转换为本地日期时间,当输入日期时间和时区分别给出时,如下所示
- Date -20220120080000 ('yyyymmddHHMMSS')
- timezone string -("Australia/Perth")
如何将以上时区转换为本地日期时间不使用矩库?
I want to convert given Date time to local Date time, when input Date time and timeZone is given separately as below
- Date -20220120080000 ('yyyymmddHHMMSS')
- timezone string -("Australia/Perth")
How to convert above timezone to local Date time without using moment library ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果你能够利用时刻,这就会变得非常简单。
检查此工作示例。
If you are able to use moment, this becomes pretty straightforward.
Check this working example.