Finding Future Dates
Posted: Sun Sep 14, 2008 10:07 am
I'm trying to write a script that will randomly pick a date 1-5 days from today that will eventually be updated into the mysql in a certain field which is set as DATE so I need it to read out as YYYY-mm-dd. I haven't done a lot with date and in my research have found mktime code and CURDATE() but I can't get either to work right in finding a future date. I can echo it correctly but not have it update=mysql correctly. I was playing around with something like this:
But its not working so I must be in the completely wrong direction. Can someone point me toward the correct code I should be using to find a future day that can then be updated into the database in a DATE feild. If you can point me in the right direction I can search for some tutorials.
Thanks!
Code: Select all
$twodays = mktime(0, 0, 0, date("Y"), date("m"), date("d")+2);But its not working so I must be in the completely wrong direction. Can someone point me toward the correct code I should be using to find a future day that can then be updated into the database in a DATE feild. If you can point me in the right direction I can search for some tutorials.
Thanks!