From: Javier Jardón Date: Fri, 2 Sep 2011 16:09:07 +0000 (+0100) Subject: g_date_time_format: support %C X-Git-Tag: 2.29.90~61 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e975b5b75c6e61ae417ad6a56cf9b9a86ec7d61a;p=platform%2Fupstream%2Fglib.git g_date_time_format: support %C %C represents the century number (year/100) as a 2-digit integer https://bugzilla.gnome.org/show_bug.cgi?id=658061 --- diff --git a/glib/gdatetime.c b/glib/gdatetime.c index 75f8338..e37857d 100644 --- a/glib/gdatetime.c +++ b/glib/gdatetime.c @@ -2157,6 +2157,11 @@ get_numeric_format (gchar *fmt, * the preferred date and time representation for the current locale * * + * %%C: + * + * The century number (year/100) as a 2-digit integer (00-99) + * + * * %%d: * * the day of the month as a decimal number (range 01 to 31) @@ -2422,6 +2427,9 @@ g_date_time_format (GDateTime *datetime, g_free (tmp); } break; + case 'C': + get_numeric_format (fmt, sizeof(fmt), alt_digits, pad_set ? pad : '0', 2); + g_string_append_printf (outstr, fmt, g_date_time_get_year (datetime) / 100); case 'd': get_numeric_format (fmt, sizeof(fmt), alt_digits, pad_set ? pad : '0', 2); g_string_append_printf (outstr, fmt, g_date_time_get_day_of_month (datetime));