Skip to main content

Date & Time

All dates and times in the stormglass API are in UTC. When sending requests to the API, we accept UNIX timestamps - 1542967200 and URL Encoded ISO Formatted timestamps - 2018-11-23T10%3A00%3A00%2B00%3A00.

The API also accepts timestamps to be specified as prefixes of URL-encoded timestamps formatted using the ISO format. This allows a specific date to be specified as YYYY-MM-DD and a specific date and hour to be specified as YYYY-MM-DDTHH and so forth.

Please note that all omitted components will default to zero and that the time zone component is ignored.

Date and time returned from the API will be expressed in ISO format - 2018-11-23T10:00:00+00:00.

Local time​

All timestamps sent to and received from the API use UTC. To display data in a user's local time zone, convert timestamps client-side using a standard datetime library (to safely handle date rollovers across time zones). See the examples below for offsets behind and ahead of UTC.

Behind UTC​

Seattle, USA is behind UTC by 8 hours when using the Pacific Standard Time or PST time zone. When using the Pacific Daylight Time or PDT time zone, Seattle is behind UTC by 7 hours.

Weather data may be requested for the local date 2018-11-23 by adjusting request timestamps forwards by the current time difference compared to UTC. This means specifying the start and end request parameters as 2018-11-23T08:00:00 and 2018-11-24T08:00:00 for the PST time zone. Timestamps in the response data are to be adjusted backwards to become local timestamps.

Ahead of UTC​

Sydney, Australia is ahead of UTC by 10 hours when using the Australian Eastern Standard Time or AEST time zone. When using the Australian Eastern Daylight Time or AEDT time zone, Australia is ahead of UTC by 11 hours.

Weather data may be requested for the local date 2018-11-23 by adjusting request timestamps backwards by the current time difference compared to UTC. This means specifying the start and end request parameters as 2018-11-22T13:00:00 and 2018-11-23T13:00:00 for the AEDT time zone. Timestamps in the response data are to be adjusted forwards to become local timestamps.