New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not use UNIX epochs as timestamps #20
Comments
|
I agree with you in every point. Admittedly, I gave in on this a bit too quickly, which is why the DEP-11 specification has a Thing is: We can't change the AppStream XML easily now that Anyway, let's see what Richard has to say to this again - if I change the spec on this, I want it to be implemented in libas-glib as well. |
|
Well, can't we have both? Have just date= (or time=, I don't care much about the name) encoded as ISO8601 in the AppData source files, and that gets converted to an epoch in the AppStream destination format. The parsing and conversion (which is slow, but not as slow as I initially feared) happens in the builder, and the runtime parser just uses the timestamp epoch for speed. That would make either the timestamp= (as an epoch) or time= in AppData files mandatory. Of course the other way is just to accept ISO8601 dates in timestamp for AppData files, and the generator can covert them to timestamps before exporting AppStream format. That might upset the some people. |
|
I would probably make time/date the new default for MetaInfo files and mark the use of timestamp deprecated there (with an appropriate hint on the validator). Converting on the generator side wouldn't be a problem. |
|
I guess if you were to put a date on something like a wedding ring, I guess ISO8601 makes more sense indeed :) |
|
I've got a patch adding support for reading the ISO8601 |
|
I think that attribute should rather be named |
|
I don't think |
|
Well, a date is also a time, while when using date alone, allowing a time is not implied... Datetime looks like both parts are required (and it's slightly uglier than date or time). |
|
I talk about release dates, the time in the day (which varies by timezone) is not important to me tbh. |
|
Or, we have |
|
That would have to be In general, I'd propose these guidelines for the specification regarding the new date/time property (called just
|
|
|
|
Ping? I'd like to get this in a release before I blog next. Thanks! |
|
Definitely no new tag... I think |
|
Okay, I'll merge in later. I was going to blog again about putting release info in the AppData file, and the relation to xdg-app, but I don't want to steal your thunder if that's what you want to do :) |
… time First step towards resolving #20 The new `date` property will complement the existing `timestamp` property on release tags.
|
What I am going to write about is some general note ("write metainfo files!") and some stuff I am working on, which is a Markdown-to-metainfo file converter, since some people (me included) hate to write XML manually. Also, I wanted to blog about the "new" font support, to get some more people to write metainfo files for that. And of course, the usual does of AppStream in Debian news. |
|
Oh, and btw: Thanks @ebassi for the detailed issue report, it should be fixed in the next release of AppStream. |
|
Thanks! |
|
I think you need to use more than just g_time_val_from_iso8601(); that won't accept values like "YYYY-MM-DD" -- see the commit coming up for appstream-glib... |
|
@hughsie That's actually a bug in GLib; let me quickly fix it. |
|
Hah, I was just going to ask if we should fix this in GLib instead of working around it in two projects. |
|
Upstream bug: https://bugzilla.gnome.org/show_bug.cgi?id=760983 |
|
Thanks guys; when this is fixed in Glib I'll remove the workaround in appstream-glib |
UNIX epochs are a terrible way to specify a date and time, especially in a human readable and writable data format.
UNIX epochs have too high granularity for release metadata: I don't care if I released something less than a minute ago, and if something takes less than a second to release then something is clearly wrong. UNIX epochs have no actual size specified, so they could be loaded by 32 bit architectures or 64 bit ones; the AppStream API already has to use 64 bit wide unsigned integers to cope with this.
UNIX epochs do not have timezone information, as they are (generally, see below) relative to coordinate time; this means that I lose the timezone information of a release whenever I use the UNIX timestamp.
UNIX epochs are poorly defined, as there are a bunch of those - with leap seconds, without leap seconds, from UTC, from TAI, etc. You're basically encoding the behaviour of the
date +%scommand on your current OS whenever you use one.Humans do not know how to write UNIX timestamps; you need an ancillary tool to write them and read them, thus introducing undeclared dependencies.
Humans have invented the ISO 8601 specification, which is what everyone should be using to represent dates and times (and intervals) inside exchange formats.
The
<release/>tag in the release metadata should deprecate thetimestampattribute in favour of a newtimeattribute, which expresses the release time as an ISO 8601 string. The AppStream library API does not need to be modified, as it can convert to and from ISO 8601 dates transparently.The text was updated successfully, but these errors were encountered: