I'm having a problem regarding comparing two dates. I know this sound kinda silly but I want you all to try this example.

```
$a = date('d-m-Y', strtotime('2014-07-03'));
$b = date('d-m-Y', strtotime('2014-03-17'));
$c = date('d-m-Y', strtotime('2015-03-16'));

if(($a > $b)  && ($a < $c) ) {
    echo "1";
}
else {
    echo "2";
}

```

How come the result is 2?
['https://Stackoverflow.com/questions/24556316', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3802062/']
Your "logic" is wrong.

![xkcd](https://imgs.xkcd.com/comics/iso_8601.png)  

> [xkcd](http://xkcd.com/1179/)

```
$a = '2014-07-03';
$b = '2014-03-17';
$c = '2015-03-16';

if(($a > $b) && ($a < $c)) {
    echo "1"; // it works!
}

```

Big-endian formats are awesome.
After your date/strtotime function, you have :

```
$a = '03-07-2014'
$b = '17-03-2014'
$c = '16-03-2015'

```

So when you compare, $a is less than $b because it compares the day first.