PHP checking if two dates differs at least tree months
Posted
by
user2301515
on Stack Overflow
See other posts from Stack Overflow
or by user2301515
Published on 2013-11-11T15:19:00Z
Indexed on
2013/11/11
15:53 UTC
Read the original article
Hit count: 120
php
In php how to check if one date (given as string) differs to another date at least tree month (unable to find any examples):
$date1 = "2013-11-05";
$date2 = "2013-11-19";
//both dates is in form yyyy.mm.dd
differsTreeMonths($date1,$date2) { ???? return $differs; }
differsTreeMonths("2013-11-05","2014-05-02");//true
differsTreeMonths("2014-01-01","2014-04-01");//true
differsTreeMonths("2014-01-01","2014-03-31");//false
differsTreeMonths("2013-12-01","2014-01-15");//false
etc
Thank you
© Stack Overflow or respective owner