mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-13 14:05:05 +01:00
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
This commit is contained in:
parent
6f80dc6042
commit
e975b5b75c
@ -2157,6 +2157,11 @@ get_numeric_format (gchar *fmt,
|
|||||||
* the preferred date and time representation for the current locale
|
* the preferred date and time representation for the current locale
|
||||||
* </simpara></listitem></varlistentry>
|
* </simpara></listitem></varlistentry>
|
||||||
* <varlistentry><term>
|
* <varlistentry><term>
|
||||||
|
* <literal>%%C</literal>:
|
||||||
|
* </term><listitem><simpara>
|
||||||
|
* The century number (year/100) as a 2-digit integer (00-99)
|
||||||
|
* </simpara></listitem></varlistentry>
|
||||||
|
* <varlistentry><term>
|
||||||
* <literal>%%d</literal>:
|
* <literal>%%d</literal>:
|
||||||
* </term><listitem><simpara>
|
* </term><listitem><simpara>
|
||||||
* the day of the month as a decimal number (range 01 to 31)
|
* 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);
|
g_free (tmp);
|
||||||
}
|
}
|
||||||
break;
|
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':
|
case 'd':
|
||||||
get_numeric_format (fmt, sizeof(fmt), alt_digits, pad_set ? pad : '0', 2);
|
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));
|
g_string_append_printf (outstr, fmt, g_date_time_get_day_of_month (datetime));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user