Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APIから受け取ったUTC形式の時間情報を現地のタイムゾーンで表す #52

Open
mfykmn opened this issue Aug 16, 2017 · 1 comment

Comments

@mfykmn
Copy link

mfykmn commented Aug 16, 2017

緯度経度を入れて下のAPIを叩くとその箇所のタイムゾーンが手に入る
https://maps.googleapis.com/maps/api/timezone/json?location=36.5643009,136.627638&timestamp=1458000000&key=AIzaSyD***
{
"dstOffset" : 0,
"rawOffset" : 32400,
"status" : "OK",
"timeZoneId" : "Asia/Tokyo",
"timeZoneName" : "Japan Standard Time"
}


それを渡す!!
moment(‘2015-04-08T02:36:45.408Z’).tz(“Asia/Tokyo”).format()
‘2015-04-08T11:36:45+09:00’
@mfykmn
Copy link
Author

mfykmn commented Aug 16, 2017

http://qiita.com/mafuyuk/items/a6d0739f3f57b42696d0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant