PHP uses getdate to get the current datetime as an associative array of methods, GETDATE array
This example describes how PHP uses getdate to get the current datetime as an associative array. Share to everyone for your reference. The specific analysis is as follows:
The PHP getdate function is used to get the current date and time, from the operating system or an associative array to a UNIX-style date integer.
The syntax format is as follows
Array getdate (); array getdate (integer $Time);
The parameters are as follows:
Arguments
$Time
The number of seconds since midnight before January 1, 1970. (UNIX style.)
Default
The default is the current date and time from the operating system.)
The return value is an associative array containing:
Mon the month of the year as a number (1..12)
Mday the day of the month (1..31)
Year of the year (4 digits)
Hours the hour of the day (0..23)
Minutes the minutes of the hour (0..59)
Seconds the seconds of the minute (0..59)
Month the month of the year as a word (January. December)
Yday the day of the Year (0..365)
Wday the day of the week as a number (0..6)
Weekday the day of the week as a word (Sunday. Saturday)
0 Seconds since midnight before January 1, 1970
Here is an example of usage:
<?php$now = getdate (), foreach ($Now as $Key + $Value) {echo "$Key + $Value \ n";}? >
The output results are as follows:
seconds = 59minutes = 14hours = 7mday = 26wday = 6mon = 12year = 2009yday = 359weekday =&G T Saturdaymonth = December0 = 1261811699
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/970866.html www.bkjia.com true http://www.bkjia.com/PHPjc/970866.html techarticle PHP uses getdate to get the current datetime as an associative array method, GETDATE Array This example describes the way PHP uses getdate to get the current datetime as an associative array ...