For a time issue, the current date is obtained through the control: PHPcode $ thisday =$ _ GET ['calendar']; now I want to calculate the day before the date (the day before the calendar date ), how can this problem be solved? Note: The calendar string format is Y-m-d,-1day, echodate ('Y-m-D', strtotime (& q a question about time
The current date is obtained through the control:
PHP code
$ Thisday = $ _ GET ['Calendar '];
Now I want to find the day before this date (the day before the calendar date). how can I find it?
Note: The string form of the calendar is Y-m-d.
------ Solution --------------------
-1day
------ Solution --------------------
Echo date ('Y-m-D', strtotime ("-1 day $ thisday "));
------ Solution --------------------
If the time format of $ _ GET ['Calendar '] is similar to "11:56:30", it is first converted to the time format: strtotime ($ _ GET ['Calendar'])
Then subtract the number of seconds in a day: strtotime ($ _ GET ['Calendar '])-60*60*24