[glib] datetime: Use %Z for the timezone name
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] datetime: Use %Z for the timezone name
- Date: Wed, 25 Aug 2010 13:08:00 +0000 (UTC)
commit 0a59ab6e8594f0f2f9203390052364bef9212697
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Wed Aug 25 12:14:04 2010 +0100
datetime: Use %Z for the timezone name
We should try and follow strftime(3) for the format control characters
as much as possible.
glib/gdatetime.c | 4 ++--
glib/tests/gdatetime.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/glib/gdatetime.c b/glib/gdatetime.c
index b9685b6..ead17cd 100644
--- a/glib/gdatetime.c
+++ b/glib/gdatetime.c
@@ -1809,7 +1809,7 @@ g_date_time_new_now (void)
* the date.
* %%y The year as a decimal number without the century.
* %%Y The year as a decimal number including the century.
- * %%z The timezone or name or abbreviation.
+ * %%Z Alphabetic time zone abbreviation (e.g. EDT).
* %%% A literal %% character.
*
* Return value: a newly allocated string formatted to the requested format or
@@ -1983,7 +1983,7 @@ g_date_time_printf (const GDateTime *datetime,
g_string_append_printf (outstr, "%d",
g_date_time_get_year (datetime));
break;
- case 'z':
+ case 'Z':
if (datetime->tz)
g_string_append_printf (outstr, "%s", datetime->tz->name);
else
diff --git a/glib/tests/gdatetime.c b/glib/tests/gdatetime.c
index ae8ef3a..d204714 100644
--- a/glib/tests/gdatetime.c
+++ b/glib/tests/gdatetime.c
@@ -905,7 +905,7 @@ GDateTime *__dt = g_date_time_new_from_date (2009, 10, 24); \
TEST_PRINTF ("%%", "%");
TEST_PRINTF ("%", "");
TEST_PRINTF ("%9", NULL);
- TEST_PRINTF ("%z", dst);
+ TEST_PRINTF ("%Z", dst);
}
gint
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]