在 angularjs 中显示带有当前时区的日期 [英] Display Date with Current Timezone in angularjs

查看:26
本文介绍了在 angularjs 中显示带有当前时区的日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 Angular js 中使用当前 UTC 时区缩写显示日期.例如,我想将日期显示为 SEPTEMBER 2, 2014 3:15 PM PST 或 SEPTEMBER 2, 2014 3:15 PM IST 等

How to display date with current UTC timezone abbreviation in Angular js. For example I want to display date as SEPTEMBER 2, 2014 3:15 PM PST or SEPTEMBER 2, 2014 3:15 PM IST, etc

推荐答案

AngularJS 仅支持 'UTC' 时区.您可以参考此API 参考了解详情.相反,您可以使用其他 JS 库来做这件事.建议使用 moment-timezone.js

AngularJS only supports 'UTC' timezone. You could refer to this API Reference for details. Instead, you could use other JS library to do this thing. Suggest using moment-timezone.js

这篇关于在 angularjs 中显示带有当前时区的日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆