Skip to content

Commit

Permalink
Merge pull request #1099 from radiantearth/utc
Browse files Browse the repository at this point in the history
All timestamps in UTC
  • Loading branch information
m-mohr authored Apr 23, 2021
2 parents dfb2300 + 14fec94 commit b8d8b5e
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- The first extent in a Collection is always the overall extent, followed by more specific extents. ([#1064](https://github.com/radiantearth/stac-spec/issues/1064), [opengeospatial/ogcapi-features#520](https://github.com/opengeospatial/ogcapi-features/pull/520))
- Updated examples for automatic collection creation from code and validation ([#1080](https://github.com/radiantearth/stac-spec/pull/1080)
- Clarified that stac_extensions should also list extensions that are used in Collection summaries. ([#1077](https://github.com/radiantearth/stac-spec/issues/1077))
- `changed`, `created` (common metadata) and temporal extents (collections): Timestamps must be always in UTC ([#1095](https://github.com/radiantearth/stac-spec/issues/1095))

## [v1.0.0-rc.2] - 2021-03-30

Expand Down
2 changes: 1 addition & 1 deletion collection-spec/collection-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ Clients only interested in the overall extent will only need to access the first
It is recommended to only use multiple temporal extents if a union of them would then include a large
uncovered time span (e.g. only having data for the years 2000, 2010 and 2020).

Each inner array consists of exactly two dates and times.
Each inner array consists of exactly two dates and times, each in UTC.
Each date and time MUST be formatted according to [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6).
The temporal reference system is the Gregorian calendar.

Expand Down
3 changes: 2 additions & 1 deletion collection-spec/json-schema/collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@
"string",
"null"
],
"format": "date-time"
"format": "date-time",
"pattern": "(\\+00:00|Z)$"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions item-spec/common-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ Fields to provide additional temporal information such as ranges with a start an
| Field Name | Type | Description |
| ---------- | ------------ | ----------- |
| datetime | string\|null | See the [Item Spec Fields](item-spec.md#properties-object) for more information. |
| created | string | Creation date and time of the corresponding data (see below). |
| updated | string | Date and time the corresponding data (see below) was updated last. |
| created | string | Creation date and time of the corresponding data (see below), in UTC. |
| updated | string | Date and time the corresponding data (see below) was updated last, in UTC. |

All timestamps MUST be formatted according to [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6).

Expand Down
5 changes: 3 additions & 2 deletions item-spec/item-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ resources below.

| Field Name | Type | Description |
| ---------- | ------------ | ------------------------------------------------------------ |
| datetime | string\|null | **REQUIRED.** The searchable date and time of the assets, in UTC. It is formatted according to [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6). `null` is allowed, but requires `start_datetime` and `end_datetime` from [common metadata](common-metadata.md#date-and-time-range) to be set. |
| datetime | string\|null | **REQUIRED.** The searchable date and time of the assets, which must be in UTC. It is formatted according to [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6). `null` is allowed, but requires `start_datetime` and `end_datetime` from [common metadata](common-metadata.md#date-and-time-range) to be set. |

#### datetime

Expand All @@ -136,7 +136,8 @@ or representative time in the case of assets that are combined together. Though
complex thing to capture, for this purpose keep in mind the STAC spec is primarily searching for
data, so use whatever single date and time is most useful for a user to search for. STAC content
extensions may further specify the meaning of the main `datetime` field, and many will also add more
datetime fields.
datetime fields. **All times in STAC metadata should be in [Coordinated Universal
Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time) (UTC).**
If there's clearly no meaningful single 'nominal' time, it is allowed to use `null` instead.
In this case it is **required** to specify a temporal interval with the fields `start_datetime`
and `end_datetime` from [common metadata](common-metadata.md#date-and-time-range). For example, if
Expand Down
15 changes: 10 additions & 5 deletions item-spec/json-schema/datetime.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,34 @@
"title": "Date and Time",
"description": "The searchable date/time of the assets, in UTC (Formatted in RFC 3339) ",
"type": ["string", "null"],
"format": "date-time"
"format": "date-time",
"pattern": "(\\+00:00|Z)$"
},
"start_datetime": {
"title": "Start Date and Time",
"description": "The searchable start date/time of the assets, in UTC (Formatted in RFC 3339) ",
"type": "string",
"format": "date-time"
"format": "date-time",
"pattern": "(\\+00:00|Z)$"
},
"end_datetime": {
"title": "End Date and Time",
"description": "The searchable end date/time of the assets, in UTC (Formatted in RFC 3339) ",
"type": "string",
"format": "date-time"
"format": "date-time",
"pattern": "(\\+00:00|Z)$"
},
"created": {
"title": "Creation Time",
"type": "string",
"format": "date-time"
"format": "date-time",
"pattern": "(\\+00:00|Z)$"
},
"updated": {
"title": "Last Update Time",
"type": "string",
"format": "date-time"
"format": "date-time",
"pattern": "(\\+00:00|Z)$"
}
}
}

0 comments on commit b8d8b5e

Please sign in to comment.