![]() |
PHP Date function help required I am getting current date in php using date function but what I want is date before 15 days. I mean if today is 15th jan then i want it 1st Jan as a date. Thanks |
Re: PHP Date function help required You can use strtotime function for that here is an example for what you are looking for PHP Code: |
Re: PHP Date function help required Or you can use if you are using greater than php 5.3 $date = new DateTime(date("Y-m-d")); $date->modify('-15 day'); echo $date->format('Y-m-d'); |
Re: PHP Date function help required Hope this helps <?php echo date("jS F", strtotime('+15 days')); ?> |
Re: PHP Date function help required <?php echo date("Y/m/d") . "<br>"; echo date("Y.m.d") . "<br>"; echo date("Y-m-d"); ?> output:: 2013/07/12 2013.07.12 2013-07-12 |
| All times are GMT -6. The time now is 11:58 AM. |