|
| |||||||||
| Tags: date function, display yesterday date, php, strtotime, syntax |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| How to get date of yesterday in php
I am looking for program in php which display yesterday date. The date function in php is use to calculate the date but what are the syntax need to used in this function so it will display yesterday date. Any recommendations and suggestions are appreciated. |
|
#2
| ||||
| ||||
| Re: How to get date of yesterday in php Code: <?php // yesterday in 'd-m-Y' format $ts['yesterday'] = strtotime( '-1 days' ); // or, strtotime( 'yesterday' ); echo "Yesterday: ", date( 'd-m-Y', $uts['yesterday'] ), "<br />\n"; // the day before yesterday in 'd-m-Y' format $ts['day-before-yesterday'] = strtotime( '-2 days' ); echo "The day before yesterday: ", date( 'd-m-Y', $uts['day-before-yesterday'] ), "<br />\n"; ?> |
|
#3
| |||
| |||
| Re: How to get date of yesterday in php
To get date of yesterday in php follow the code given below : Code: $yesterday = date('d/m/y', mktime(0, 0, 0, date("m") , date("d") - 1, date("Y"))); Code: strtotime("-1 day") |
|
#4
| |||
| |||
| Re: How to get date of yesterday in php Code: $yesterday = strtotime("-1 day"), "\n";
$yesterday = " ".date("m, Y", $yesterday); |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "How to get date of yesterday in php" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Baseline Column Date automatically updates Finish Date | Adam 1980 | Microsoft Project | 3 | 18-05-2011 07:08 PM |
| my smps stop working from yesterday which is of 700 W while playing mafia 2 | ajay arya | Monitor & Video Cards | 1 | 22-02-2011 04:03 PM |
| Same problem from yesterday Unable to send my aol mail via windows | nufcquigs | Windows Vista Mail | 4 | 18-10-2010 11:46 AM |
| Windows Media Player won't play ANY music it played yesterday | hmboomer | Media Player | 1 | 25-06-2010 04:01 AM |
| Changing start date and creating formula for finish date | Lisa M | Microsoft Project | 2 | 11-09-2006 06:10 PM |