codrgii Posted October 21, 2010 Share Posted October 21, 2010 How in PHP am i able to select a date from a table and compare that date with a period of 2 months? In sql we use something like select @2_months_later_date =dateadd(mm,2,getdate()) how would that be done in php? Link to comment https://forums.phpfreaks.com/topic/216502-comparing-date/ Share on other sites More sharing options...
AbraCadaver Posted October 21, 2010 Share Posted October 21, 2010 $two_months_later_date = strtotime('+2 months'); Link to comment https://forums.phpfreaks.com/topic/216502-comparing-date/#findComment-1124986 Share on other sites More sharing options...
schilly Posted October 21, 2010 Share Posted October 21, 2010 $two_months_later_date = strtotime('+2 months'); Nice. good tip. I always used mktime(). Link to comment https://forums.phpfreaks.com/topic/216502-comparing-date/#findComment-1124988 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.