Strftime Date Time formatting

Source: Internet
Author: User
Tags month name

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.