I have following JavaScript code with sending request to Stormglass weather API:
const lat = 58.7984;
const lng = 17.8081;
const params = 'waveHeight,airTemperature';
const start = new Date("2022.02.28, 16:00").getTime();
console.log(start);
fetch(`https://api.stormglass.io/v2/weather/point?lat=${lat}&lng=${lng}&start=${start}¶ms=${params}`, {
headers: {
'Authorization': '<api_key>'
}
}).then((response) => response.json()).then((jsonData) => {
console.log(jsonData);
});
In response I get error message "1646046000000 is not a valid UTC timestamp". According to API parameter 'start' should be Timestamp in UTC for first forecast hour - UNIX format or URL encoded ISO format. I suppose my timestamp is correct. What could be the problem here?