Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
938 views
in Technique[技术] by (71.8m points)

timezone - How to get time zone name from an offset?

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

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

Time Zone != Offset

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

image

...

image

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...

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.

image

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...