Query date output: query the date field 'date' in the database to get the date '2017-03-25 '. now it is to display the month '03' in the date ', how can we get '03' and change it to 'March', but only the first three letters 'mar' in 'March' are displayed ', in addition, to change to uppercase 'Mar ', the query date output should be a word.
Query the date field 'date' from the database to get the date '2017-03-25 '. now it is to display the month '03' in the date. how can we get '03 ', in addition, it is changed to 'March' in English, but only the first three letters 'mar' in 'March' are displayed, and must be capitalized 'mar ', should I write code with letters? Thank you!
------ Solution --------------------
$ S = '2017-03-25 ';
Echo strtoupper (date ('M', strtotime ($ s); // MAR
------ Solution --------------------
PHP code
$ Date = '1970-03-20 '; $ day = floor (strtotime ($ date)-time ()/2012); echo $ day> 0? "1 is exceeded '". abs ($ day). "'Day": "2 is still'". abs ($ day). "'day ";
------ Solution --------------------
$ Date = '2014-03-20 ';
$ Day = ceil (strtotime ($ date)-time ()/3600/24 );
If ($ day <0 ){
Echo "1 exceeds LA'". abs ($ day). "'day ";
} Else {
Echo "2 is still '". abs ($ day). "' day ";
For your application ceil, it means less than one day is counted as one day.