hi to all.........
i have small problem , please give suggestions how to implement this feature..........
problem:
am trying to add 7 days to current system date,but it is not correctly adding.
please tell where is the problem in my code.
code:
<?php
echo $today = date("Y-m-d").'<br/>';
$month = date("m"); //06
$year = date("Y"); //2006
$day = date("d"); //08
echo $day = $day + 7 .'<br/>';
echo date ("Y-m-d", mktime ($year,$month,$day));
?>
add some number of days to current date
Moderator: General Moderators
Yay manual!
int mktime ( [int hour [, int minute [, int second [, int month [, int day [, int year [, int is_dst]]]]]]] )
Code: Select all
echo date ("Y-m-d", mktime (0, 0, 0, $month, $day, $year));- aerodromoi
- Forum Contributor
- Posts: 230
- Joined: Sun May 07, 2006 5:21 am
Re: add some number of days to current date
How about:
aerodromoi
Code: Select all
<?php
echo date("Y-m-d",strtotime("+1 week"));
?>