# Check if date has passed

**URL:** <https://forum.kirupa.com/t/check-if-date-has-passed/323664>\
**Category:** flash\
**Created:** [July 11, 2011, 8:03pm UTC](https://forum.kirupa.com/t/check-if-date-has-passed/323664 "2011-07-11T20:03:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pedromau](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/pedromau/32/2793_2.png) [@pedromau](https://forum.kirupa.com/u/pedromau)\
**Post date:** [July 11, 2011, 8:03pm UTC](https://forum.kirupa.com/t/check-if-date-has-passed/323664/1 "2011-07-11T20:03:40Z")

</div>

I’m trying to see if a specific date has passed but it’s not working.  
Here’s my code so far:

```php

var currDate:Date = new Date();
checkIfDateHasPassed = function(y, m, d){
        var myDate:Date = new Date(y, m, d); 
        if(myDate > currDate){
            trace("still to come");
        } else {
            trace("has passed");
        }
}
// since month starts in Zero, July will be 6 instead 7
// I'm trying to use yesterday, but its not working...
checkIfDateHasPassed(2011, 6, 10);

```
