The strftime () function converts month and time display to Chinese mode.
definition and usage
strftime () function to format the local time / date according to the area settings.
syntax
strftime (format, timestamp) parameter description
format optional. Specifies how to return the result.
timestamp is optional.
prompt and comment
prompt: same as gmstrftime (), the difference is that the return time is local time.
output strftime () and gmstrftime () results:
[code].lt;? Php
echo (.Quot;%b)) Trftime (.Quot; It is%a on%b%d,%Y,%X time zone:). Html
strftime () function
strftime () function -- formatting the output date and time according to the localization environment.
syntax format: strftime (format timestamp)
this function returns a string that is formatted after the given string is formatted with a parameter timestamp. If the timestamp is not given, the local time is used.
conversion markup for format parameter identification:
[code]%a - a short
%A for the current area of the current region - the full term
%b for the current region week - the short
%B for the current regional month - the full nominal
%c for the current regional month - the preferred date schedule of the current region (year) value (year) Divide by 100, range from 00 to 99)
%d - months, decimal digits (range from 01 to 31)
%D - and%m/%d/%y
%e - the decimal number, decimal number, and a digit in front of a space (range from '1' to 31 ')
%g It's the same as%G, but there is no century
%G - 4 digit years, which is in line with ISO weeks (see%V). Like the format and value of%V, it only applies to the year when ISO weeks belong to the previous year or the following year.
%h -
%H - 24 hours decimal hours (range from 00 to 23)
%I - 12 hours decimal hours (range from 00 to 12)
%j - year, decimal number (range from 001 to 366)
%m - decimal month (from 01 to 12) %M - decimal minute number
%n - />%n -
%p - `am 'or `pm' based on a given time value, or the corresponding string
%r in the current locale setting - the current time, the decimal number of
%u - weeks, like%H:%M:%S,.#91; 1,7.#93; 1 indicates that Monday
warning
although ISO 9889:1999 (the current C standard) clearly points out that a week starts from Monday, but the week of Sun Solaris appears from Sunday and as 1.
%U - the first week of the year, from the first Sunday of the first week as the first day of the first day of the first day of
%V - the ISO 8601:1988 format for the next few weeks of the year, from 01 to 53, the first week the first at least 4 days of the year, and Monday as the first day of the week. (using%G or%g as the year of the specified time stamp to correspond to the number of weeks.)
%W - the number of weeks of this year, from the first Monday of the first week as the first day of the first day, the first day of the
%w - the first day of the week, the preferred time representation of the 0
%x - the current region, not including the time
%X - the preferred time representation of the current region, excluding the date
%y – no world. Decimal year of the number of disciplines (range from 00 to 99)
%Y - including the decimal year of the century
%Z or%z - time zone name or abbreviated
instance: output localization time, date
code:
[code].lt; Le (LC_ALL, "en_US");
echo "American format:".Strftime ("Today is%A");
echo. ");
?.gt; [/code] output
American format: Today is Thursday
China format: today is the month of Thursday
month: this month is November