The strftime () function formats local time/date according to locale, functions function to format time, or to format a time string.
size_t strftime (
Char *strdest,
size_t MaxSize,
const Char *format,
Const struct TM *timeptr
);
Parameter description: We can place the time information stored in the timeptr in the string pointed to by the strdest, and store the maxsize characters in a maximum of strdest, according to format commands in format point to String. The function returns the number of characters placed in the string pointed to by strdest.
%a shorthand for the day of the week
%A full name of the week
Abbreviated%B Month
Full name of the%B month
Time string for the date of%c standard
First two digits of the%c year
The day ordinal of a month in%d decimal notation
%d Month/day/year
%e the day ordinal of a month in a two-character field, in decimal notation
%F year-month-day
%g two digits of the year, using week-based
%G year, using week-based
%h Abbreviated month name
%H 24-Hour Hour
%I 12-Hour Hour
%j decimal indicates the day ordinal of the year
%m the month represented by decimal
%M minutes in a 10 o'clock-hour representation
%n New Line character
%p equivalent display of the local AM or PM
%r 12 hours of time
%R display hours and minutes: hh:mm
%s number of seconds in decimal
%t Horizontal Tab
%T display time seconds: hh:mm:ss
%u days of the week, Monday for the first day (values from 1 to 7, Monday to 1)
%u year of the week, put Sunday as the first day (value from 0 to 53)
%V Week of the year, using week-based
%w Decimal Day of the week (value from 0 to 6, Sunday is 0)
%W Week of the year, Monday as the first day (value from 0 to 53)
Date string for%x standard
Time string for%x standard
%y decimal Year without century (values from 0 to 99)
%Y 10 year with century part
%z,%z the time zone name and returns a null character if the time zone name cannot be obtained.
Percent hundred percent semicolon
Grammar
Strftime (format,timestamp) parameter description
Format is optional. Specifies how the results are returned.
Timestamp is optional.
Hints and Notes
Strftime Date Time formatting