21489 Posts in 5783 Topics by 2622 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 414 Views |
-
time function

27 May 2010 at 10:34pm
Hi,
Can someone please help me with a time issue? I have dates in the database and want to determine if the current date is in between them. I have written a function using strtotime() which I thought was working but doesn't appear to be now. My two date fields look like this: 'RegStart' => 'Date', 'RegStop' => 'Date',
I wrote a function like this:
function openForReg() {
$regClass = DataObject::get('Product', "`Location` = 'AOQ'", "rand()", "", "1");
if (strtotime($this->RegStart) < time() AND strtotime($this->RegStop) > time()) return $regClass;
}Where am I going wrong?
Thanks for any help.
| 414 Views | ||
|
Page:
1
|
Go to Top |

