This article mainly introduces the PHP format date example, the need for friends can refer to the following
Code as follows://Format date static function FormatDate ($format, $datetime, $week = 0) { $datetime = $d Atetime > 3000? $datetime: Strtotime ($datetime); if ($week) { $weeknames = [ &NBSP ; ' Day, ' one ', , ' two ',   ; ' three ', ' four ', &N Bsp ' five ', ' six ' ]; $format = Str_replace (' W ', $weeknames [Date (' W ', $datetime)], $format); &NBSP return date ($format, $datetime); &NBSP} code is as follows: Echo "Week". FormatDate ("W", "2012-11-03 00:46:22", 1). " " . FormatDate ("y-m-d", "2012-11-03 00:46:22"); echo "Week." FormatDate ("W", "1388678400", 1). " " . FormatDate ("y-m-d", "1388678400"); Saturday 2012-11-03 Friday 2014-01-03