dougleander
Programmer
i am trying to calculate any given upcoming monday based upon a timestamp lifted from a mysql database called Posted. here is some code that i have tried to manipulate. i can get it to calculate an upcoming monday based upon today's date but not based upon the Posted date. here is the code and description.
//this returns the date the record was inserted
//in the database and works fine!
$posted = strftime("%m/%d/%Y", $row['Posted']);
echo $posted;
//this returns the next monday based on todays date
//and works great!
function test_time($time_string) {
echo strftime("%m/%d/%Y", strtotime($time_string));
}
test_time('next Monday');
//this returns 01/05/1970 no matter what date is in Posted
//can anyone tell me why please!!!
//
function test_time($time_string) {
$nextM = strftime("%m/%d/%Y", strtotime($time_string, $row['Posted']));
echo $nextM;
}
test_time('next Monday');
thanks to whomever is the brilliant mind that rips my work to shreds & saves the day!!!
dje
//this returns the date the record was inserted
//in the database and works fine!
$posted = strftime("%m/%d/%Y", $row['Posted']);
echo $posted;
//this returns the next monday based on todays date
//and works great!
function test_time($time_string) {
echo strftime("%m/%d/%Y", strtotime($time_string));
}
test_time('next Monday');
//this returns 01/05/1970 no matter what date is in Posted
//can anyone tell me why please!!!
//
function test_time($time_string) {
$nextM = strftime("%m/%d/%Y", strtotime($time_string, $row['Posted']));
echo $nextM;
}
test_time('next Monday');
thanks to whomever is the brilliant mind that rips my work to shreds & saves the day!!!
dje