diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-10-18 11:14:20 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-10-18 11:14:20 +0100 |
commit | 1081b4842dcdc60eaeea4c38f5f50ff4b50ec7d7 (patch) | |
tree | d578bc4930ebd7b4ca6d25b74f83809382aa4be8 | |
parent | 48ec7e7f380b5b70ecc97083732c56867f75d811 (diff) |
Document exactly what g_time_val_to_iso8601() producesdatetime
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=537637
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
-rw-r--r-- | glib/gtimer.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/glib/gtimer.c b/glib/gtimer.c index 7c2d415b6..fd128482b 100644 --- a/glib/gtimer.c +++ b/glib/gtimer.c @@ -464,8 +464,26 @@ g_time_val_from_iso8601 (const gchar *iso_date, * g_time_val_to_iso8601: * @time_: a #GTimeVal * - * Converts @time_ into an ISO 8601 encoded string, relative to the - * Coordinated Universal Time (UTC). + * Converts @time_ into an RFC 3339 encoded string, relative to the + * Coordinated Universal Time (UTC). This is one of the many formats + * allowed by ISO 8601. + * + * ISO 8601 allows a large number of date/time formats, with or without + * punctuation and optional elements. The format returned by this function + * is a complete date and time, with optional punctuation included, the + * UTC time zone represented as "Z", and the @tv_usec part included if + * and only if it is nonzero, i.e. either + * "YYYY-MM-DDTHH:MM:SSZ" or "YYYY-MM-DDTHH:MM:SS.fffffZ". + * + * This corresponds to the Internet date/time format defined by + * <ulink url="https://www.ietf.org/rfc/rfc3339.txt">RFC 3339</ulink>, and + * to either of the two most-precise formats defined by + * <ulink url="http://www.w3.org/TR/NOTE-datetime-19980827">the W3C Note + * "Date and Time Formats"</ulink>. Both of these documents are profiles of + * ISO 8601. + * + * Use g_date_time_format() or g_strdup_printf() if a different + * variation of ISO 8601 format is required. * * Return value: a newly allocated string containing an ISO 8601 date * |