Datetime and date-range comparsion

Posted by Ockonal on Stack Overflow See other posts from Stack Overflow or by Ockonal
Published on 2010-04-27T15:25:04Z Indexed on 2010/04/27 16:53 UTC
Read the original article Hit count: 359

Filed under:
|
|

Hello guys, I have datetime-row in mysql database. I have to check time between now and that date using php. If the range is bigger then 1 month - do somtething.

I tried something like this:

$dateFromMysql = strtotime($rowData);
$currentDate = date("m/d/y g:i A");

And then comparsion by hands. It's ugly.

© Stack Overflow or respective owner

Related posts about php

Related posts about datetime