DateTime.format

Creates a newly allocated string representing the requested format. The format strings understood by this function are a subset of the strftime() format language as specified by C99. The %D, %U and %W conversions are not supported, nor is the 'E' modifier. The GNU extensions %k, %l, %s and %P are supported, however, as are the '0', '_' and '-' modifiers. In contrast to strftime(), this function always produces a UTF-8 string, regardless of the current locale. Note that the rendering of many formats is locale-dependent and may not match the strftime() output exactly. Since 2.26

class DateTime
string
format
(
string format
)

Parameters

format string

a valid UTF-8 string, containing the format for the GDateTime

Return Value

Type: string

a newly allocated string formatted to the requested format or NULL in the case that there was an error. The string should be freed with g_free().

Meta