Php format the date and php format the date. Php format the date, and php format the date functionShowDate ($ flag0, $ timestrNULL) {get the day of the week $ warrarray (0 Sunday, 1 Monday, php format the date, php format date
Php format the date
Function ShowDate ($ flag = 0, $ timestr = NULL) {// Obtain the number of weeks $ warr = array ("0" => Sunday, "1" => Monday, "2" => Tuesday, "3" => Wednesday, "4" => Thursday, "5" => Friday, "6" => Saturday ); $ I = date ("w", $ timeStamp); // Set Beijing time and obtain the timeStamp date_default_timezone_set ('prc'); $ timeStamp = NULL; if ($ timestr) $ timeStamp = strtotime ($ timestr); else $ timeStamp = time (); // Set the time display format $ ret1 = date ("Y, m, d, H: m: s ", $ timeStamp ). "". $ warr [$ I]; $ ret2 = date ("Y-m-d H: m: s", $ timeStamp ). "". $ warr [$ I]; $ ret3 = date ("y/m/d", $ timeStamp); $ ret = $ ret1; // The first if ($ flag = 2) $ ret = $ ret2; else if ($ flag = 3) $ ret = $ ret3; return $ ret;} is returned by default ;}
Http://php.662p.com/thread-488-1-1.html
Using php to format the date function ShowDate ($ flag = 0, $ timestr = NULL) {// Get the day of the week $ warr = array ("0" = Sunday, "1" = Monday ,...