如何从偏移量获取时区名称? [英] How to get time zone name from an offset?

查看:126
本文介绍了如何从偏移量获取时区名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用moment timezone进行时区计算.我所有的偏移量数据都来自db,例如GMT,GMT + 1,GMT + 2,GMT + 3,GMT + 4等

I am using moment timezone for timezone calculations . All i have some offset data coming from db like GMT,GMT+1,GMT+2,GMT+3,GMT+4 etc

无论如何,我可以从该数据中获取时区或类似"America/Los_Angeles"的时区名称吗?

Is their anyway i could get the timezone or timezone name like "America/Los_Angeles" from this data ?

推荐答案

我不是无礼的意思,但认真的说-我必须大声喊多少次?

I don't mean to be rude, but seriously - How many times and how loudly do I have to shout this?

我的意思是-仅在标签标头,以及时区标签Wiki的正文:

I mean - it's only in the timezone tag header, and the body of the timezone tag wiki:

...

这不是我还没有回答此问题最佳做法文档 ,或乱丢了其他数百篇带有时区!=偏移"注释的帖子...

And it's not like I haven't already answered this question, or this one, or addded it to the best practices doc, or littered what must be hundreds of other posts with "Time Zone != Offset" comments...

我知道,也许我会在高调的开发人员大会上谈论这个问题,因为我的衬衫上印有"Time Zone!= Offset",这样它才沉入水中.哦,等等-

I know, maybe I'll go talk about this at a high profile developer conference with "Time Zone != Offset" on my shirt just so it sinks in. Oh wait - done that already too.

事先为道歉的答案表示歉意,但是像重复重复一样,重复重复并没有那么有趣.

Apologies in advance for the snarky answer, but close as duplicate of duplicate of duplicate just wasn't as much fun.

这篇关于如何从偏移量获取时区名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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