wgu-opensource / osmt

OSMT is the Open Skills Management Tool
https://osmt.io
Other
44 stars 8 forks source link

Collection publishDate metadata doesn't include time zone #394

Open ottonomy opened 1 year ago

ottonomy commented 1 year ago

Describe the bug

When I request GET /api/collections I got back a resource with a "publishDate":"2023-05-01T23:34:24". This doesn't specify a timezone offset from UTC (or a "Z" to indicate UTC). It's unclear when to interpret this datetime.

To Reproduce

Steps to reproduce the behavior:

  1. Turn on OSMT
  2. Create at least one collection, and publish it.
  3. Request GET /api/collections
  4. Observe no TZ indicator on publishDate, and other dates.
  5. Expected behavior

    Server should know what time zone it's running in. Datetimes should be serialized in UTC with a "Z" timezone identifier. Best to save them to the database in UTC if possible, but translation to UTC at API request time is OK too.