Diffusion Krita 127e81f14d91

Properly handle timezones and user’s preferred date format in bundles

Authored by huftis on Aug 2 2019, 12:10 PM.

Description

Properly handle timezones and user’s preferred date format in bundles

Before: The ‘created’ and ‘updated’ times were stored as datetimes
in the author’s time zone, but *without* a time zone marker. If a
different user had a different time zone, the time displayed would
be wrong (e.g., it could be a datetime in the future). Also, the
format of the displayed time was a strange mix of locale-aware
stuff (e.g. localised month names) and non-locale aware stuff
(the order of the different components in the datetime).

Now: The times are always stored as UTC datetimes, with an explicit
datetime marker (‘Z’). (So no information about the author’s
location is leaked.) They are always shown in the user’s preferred
short datetime format (and in the user’s time zone).

The above is true for ‘created’ and ‘updated’ times stored as
actual datetimes. Older versions of Krita only stored the date,
and in the fixed ‘dd/mm/yyyy’ format. For these bundles, the date
is displayed in the user’s preferred short date (not datetime)
format.