GNOME Bugzilla – Bug 335425
Add ISO8601 timestamp conversion functions
Last modified: 2006-03-23 13:11:14 UTC
Many web applications would benefit by having a standard implementation of way to convert timestamps to/from ISO 8601 formatted strings. The patch below adds two functions which convert ISO 8601 encoded string to and from a GTimeVal. the iso 8601 parser code is based on the equivalent code from libsoup.
Created attachment 61731 [details] [review] the proposed patch patch is against GLib HEAD
Looks fine to me. Feel free to commit, with the following additions: a) Add the two new functions to docs/reference/glib/glib-sections.txt, next to g_time_val_add b) Add some tests, maybe in tests/testglib.c (which is our grab bag of tests). Probably do some roundtrip tests, and maybe some tests using wierd locales to verify that locale does not affect the outcome.
okay, new patch addressing a) and b) if it's okay, I'm going to commit this.
Created attachment 61819 [details] [review] updated patch
2006-03-23 Emmanuele Bassi <ebassi@cvs.gnome.org> * configure.in: Check for timegm. * glib/gtimer.h: * glib/gtimer.c: * glib/glib.symbols: * docs/reference/glib/glib-sections.txt: Added g_time_val_to_iso8601 and g_time_val_from_iso8601, to convert a GTimeVal to and from an ISO 8601 encoded date. * tests/testglib.c: Added test cases for g_time_val_to_iso8601() and g_time_val_from_iso8601() functions.
Sorry to bug in here, but this sounds like an api addition and glib 2.10 is already released. The functions are marked since '2.10' but they are not available in the first version of glib 2.10. Am I missing something obvious?
(replying to comment #6): I can mark these functions as "Since: 2.12", if Matthias is going to release HEAD as 2.12.
We forgot to branch first.