I am currently creating an app through React which connects to the OpenWeatherAPI. The app is when someone types in there location it pulls the weather of their specific location. The issue I am having is converting the timestamp of the specific location to a local time. I have used MomentJs, but the time keeps up coming wrong. The issue for example if someone chooses Tokyo, Japan I want it to show that the sunrise will be 6:50 am their local time. Right now I am getting back Mon Dec 28 2020 16:50:24 GMT-0500 (Eastern Standard Time).
This is the API snippet:
{
"dt": 1609176171,
"sys": {
"type": 1,
"id": 8074,
"country": "JP",
"sunrise": 1609192224,
"sunset": 1609227369
},
"timezone": 32400,
"id": 1862143,
"name": "Horinouchi",
"cod": 200
}