Function

GLibDatestrftime

Declaration

gsize
g_date_strftime (
  gchar* s,
  gsize slen,
  const gchar* format,
  const GDate* date
)

Description

Generates a printed representation of the date, in a [locale][setlocale]-specific way. Works just like the platform’s C library strftime() function, but only accepts date-related formats; time-related formats give undefined results. Date must be valid. Unlike strftime() (which uses the locale encoding), works on a UTF-8 format string and stores a UTF-8 result.

This function does not provide any conversion specifiers in addition to those implemented by the platform’s C library. For example, don’t expect that using g_date_strftime() would make the `Fprovided by the C99strftime()` work on Windows where the C library only complies to C89.

Parameters

s gchar*
 

Destination buffer.

 The data is owned by the caller of the function.
 The string is a NUL terminated UTF-8 string.
slen gsize
 

Buffer size.

format const gchar*
 

Format string.

 The data is owned by the caller of the function.
 The string is a NUL terminated UTF-8 string.
date GDate
 

Valid GDate.

 The data is owned by the caller of the function.

Return value

Returns: gsize
 

Number of characters written to the buffer, or 0 the buffer was too small.