"; //Outputs: Today is Saturday the 24 of May echo date ("l dS of F Y h:i:s A")."
"; //Outputs: Saturday 24th of May 2003 11:44:19 AM
a Lowercase Ante meridiem and Post meridiem am or pm A Uppercase Ante meridiem and Post meridiem AM or PM B Swatch Internet time 000 through 999 d Day of the month, 2 digits with leading zeros 01 to 31 D day as three letters Mon through Sun F month as January or March January through December g 12-hour format of an hour without leading zeros 1 through 12 G 24-hour format of an hour without leading zeros 0 through 23 h 12-hour format of an hour with leading zeros 01 through 12 H 24-hour format of an hour with leading zeros 00 through 23 i Minutes with leading zeros 00 to 59 j Day of the month without leading zeros 1 to 31 l day of the week Sunday through Saturday L Whether it's a leap year 1, 0 otherwise. m Numeric month, 01 through 12 M month as letters Jan through Dec n Numeric month, without leading zeros 1 through 12 r RFC 822 formatted date Expl: Thu, 21 Dec 2000 16:01:07 +0200 s Seconds, with leading zeros 00 through 59 S English ordinal suffix for the day of the month, 2 characters st, nd, rd or th. Works well with j t Number of days in the given month 28 through 31 T Timezone setting of this machine Examples: EST, MDT ... U Seconds since the Unix Epoch w Numeric day of the week 0 (Sunday) through 6 (Saturday) W ISO-8601 week number of year Y full numeric year, 4 digits Examples: 1999 or 2003 y A two year Examples: 99 or 03 z The day of the year 0 through 366 Z Timezone offset in seconds.You can prevent a recognized character in the format string from being expanded by escaping it with a preceding backslash. If the character with a backslash is already a special sequence, you may need to also escape the backslash. Example:
mktime() is useful in combination with date() or strftime():
Last day in Feb 2000 is: %d
", $lastday);
"seconds" seconds 0 to 59
"minutes" minutes 0 to 59
"hours" hours 0 to 23
"mday" the day of the month 1 to 31
"wday" the day of the week 0 (for Sunday)
through 6 (for Saturday)
"mon" a month 1 through 12
"year" year, 4 digits Examples: 1999 or 2003
"yday" day of the year 0 through 366
"weekday" day of the week Sunday through Saturday
"month" month, January through December
Example:
string setlocale ( mixed category, string locale [, string ...]):
Category is a named constant (or string) specifying the category of
the functions affected by the locale setting:
LC_ALL for all of the below LC_TIME for date and time formatting with strftime() LC_COLLATE for string comparison, see strcoll() LC_CTYPE for character classification and conversion LC_MONETARY for localeconv() LC_NUMERIC for decimal separatorlocale is the language string, for example "nl_NL" or "de_DE", if zero or "0", the current setting is returned. Setlocale returns the new current locale, or FALSE if the locale functionality is not implemented in the platform.
Example:
string strftime ( string format [, int timestamp]):
Formats a local time/date according to locale settings
using the given timestamp or the current local time if no timestamp is
given.
Month and weekday names and other language dependent strings
respect the current locale set with setlocale().
The following (and more ) conversion specifiers
are recognized in the format string:
%a - abbreviated weekday name
%A - full weekday name
%b - abbreviated month name
%B - full month name
%c - preferred date and time representation for the current locale
%C - century number (range 00 to 99)
%d - day of the month as a decimal number (range 01 to 31)
%D - same as %m/%d/%y
%e - day of the month as a decimal number,
a single digit is preceded by a space (range ' 1' to '31')
%g - like %G, but without the century.
%G - The 4-digit year
%H - hour as a decimal number using a 24-hour clock (range 00 to 23)
%I - hour as a decimal number using a 12-hour clock (range 01 to 12)
%j - day of the year as a decimal number (range 001 to 366)
%m - month as a decimal number (range 01 to 12)
%M - minute as a decimal number
%n - newline character
%p - either `am' or `pm'
%r - time in a.m. and p.m. notation
%R - time in 24 hour notation
%S - second as a decimal number
%t - tab character
%T - current time, equal to %H:%M:%S
%u - weekday as a decimal number [1,7], with 1 representing Monday
%U, %V, %W - different week numbers of the current year,
%w - day of the week as a decimal, Sunday being 0
%x - preferred date representation for locale without the time
%X - preferred time representation for locale without the date
%y - year as a decimal number without a century (range 00 to 99)
%Y - year as a decimal number including the century
%Z - time zone or name or abbreviation
%% - a literal `%' character
Example:
string microtime ( void): Returns current UNIX timestamp with microseconds as the string "msec sec". Example: