PHP time is generally divided into two formats, one is the standard time format timestamp, that is, y-m-d g:i:s. The other is the time stamp. For example: One, Standard time and timestamp conversions://gain service-side system timeDate_default_timezone_set (PRC); $nowtime=date ("y-m-d g:i:s"); //The standard time is converted to time stamp$dateline =Strtotime ($nowtime); //time stamp to standard time$nowtime =date ('h:i:s', $dateline); Second, date increase fixed number of days://The standard time is converted to time stamp$dateline =Strtotime ($nowtime); //set the specified time$days =3600* -* -;//20 days$new _dateline= $dateline-$days; //increase the new timestamp to standard time after a fixed number of days$new _nowtime=date ('y-m-d g:i:s', $new _dateline);
Three, standardized week expression://gain service-side system time$today =""; Date_default_timezone_set (PRC); Setting the time zone
$YMD _time=date ("y year M month D Day h:i:s"); $workday=date ("W"); $workday _arr=array ("Day","a","two","three","Four","Five","Six");//Normalize Week expression$today = $Ymd _time."Week". $workday _arr[$workday];
Echo $today; //output such as: September 13, 2015 10:20:23 Sunday
Four, get every morning time:
Echo strtotime (Date (' y-m-d '));
echo "\ n";
echo Date (' y-m-d h:i:s ', Strtotime (date (' y-m-d '));
Time output format for PHP