PHP add date (easy one hopefully!)
-
In Dreamweaver MX (phpcode) Hi, Im trying to put a date in a text box that has +14days from the current date, how would you do this. Is it something like "date()+14" I cant get it working!!!!
-
In Dreamweaver MX (phpcode) Hi, Im trying to put a date in a text box that has +14days from the current date, how would you do this. Is it something like "date()+14" I cant get it working!!!!
The PHP mktime function is what you want: Linkety[^]
$todayArray = explode("-", date("M-d-Y"));
$future = date("M-d-Y", mktime(0, 0, 0, $todayArray[0],``` `$todayArray[1]+140``,` ```
`$todayArray[2]``));`
Brad Australian - Captain See Sharp on "Religion" any half intelligent person can come to the conclusion that pink unicorns do not exist.
-
The PHP mktime function is what you want: Linkety[^]
$todayArray = explode("-", date("M-d-Y"));
$future = date("M-d-Y", mktime(0, 0, 0, $todayArray[0],``` `$todayArray[1]+140``,` ```
`$todayArray[2]``));`
Brad Australian - Captain See Sharp on "Religion" any half intelligent person can come to the conclusion that pink unicorns do not exist.
But where do i put this in the code? I have tried to insert this code in the initial value box and it still doesnt work... grrrr!!!
-
But where do i put this in the code? I have tried to insert this code in the initial value box and it still doesnt work... grrrr!!!
ok this depends exactly what you want to do with the value you get also brad does your solution take into account month and year (and leap year) rollovers?
"there is no spoon" {me}
-
But where do i put this in the code? I have tried to insert this code in the initial value box and it still doesnt work... grrrr!!!
-
ok this depends exactly what you want to do with the value you get also brad does your solution take into account month and year (and leap year) rollovers?
"there is no spoon" {me}