Forum Moderators: coopster
//assuming a $_POST was made...
//dealing with date cols in two tables - tbl_1 and tbl_2
$rightnow = date(whatever format);
$targettime = retrieve correct date_col value by query from tbl_1
// here's my question
if($rightnow less than 15 minutes BEFORE $targettime){
//reset date_col in tbl_1 to $rightnow + 15 minutes?
}else{
//do nothing
}
the dates are stored in mysql like 2005-12-19 10:00:58
but I can reformat them if necessary. Is the easiest way to convert all to UNIX timestamp and count the seconds for the comparison?
if anyone knows... thanks
How I solved it is: (bear in mind that I am lazy and do not code properly) I just used php to translate the raw date string to a unix timestamp, do the math, then (if necessary) translate back to the date string on the fly.
It's for a little auction app that the guy wanted to have the auction close either at the close time listed, or 15 minutes after the last bid - thus the time reset thing. I wanted the date stored in the mysql format because the guy who is going to admin the thing is not that savvy, and he has to put the date in a form manually for each auction he does. So it works great. It's a fairly light traffic, big ticket item auction. My solution might not do well for heavy traffic.