mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-06 01:16:17 +01:00
datetime: Use %Z for the timezone name
We should try and follow strftime(3) for the format control characters as much as possible.
This commit is contained in:
parent
b4c0b958af
commit
0a59ab6e85
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user