-
-
- Small example of php date function - bbs.it-home.org
- < ;body>
- echo time();//Output the number of seconds (timestamp) from 0:00:00 on January 1, 1970 to the current time
- echo "
";
- echo mktime(23,56,59,12,20,1999);//Output the timestamp of the specified time (hour, minute, second, month, day, year)
- echo mktime(23,56,59,13,20,1999);// If the time exceeds, extrapolate downward
- echo "
#------------strtotime function-----------------# ";
- echo strtotime("2009-10-12 20:20:29");//Convert the specified time and date into a timestamp, month, day and year connection
- //You can only use - or /, hours, minutes and seconds The connection can only be:
- echo strtotime("2009/10/12 20/20/29");//Unable to output
echo " #------ -------getdate, date function---------------# ";
- print_r(getdate());//Returns the date array under the current timestamp , the default is the current timestamp
- $arrtime=getdate(strtotime("2009-10-12 20:20:29"));//Returns an array of the specified date and timestamp
- echo "
";
- echo $ arrtime["minutes"];
- echo "
";
- echo date("Y‖m‖d H‖i‖s A");//Enter the date format of the specified date and timestamp, the default is the current time Poke
- echo "
";
- echo date("Y year m month d day H hour i minute s second A",strtotime("2009-10-12 20:20:29"));
- ?> ;
|