Hmmm... Lots of people seem to be having trouble getting this to work. I never have needed to use it, so I can't say from experience where the issue lies. However, i do have a solution.
Simply, when you do this on an item, it will be a property of a DataObject, so we can simply build a method into the model called 'hasExpired'.
Simply in the model we need to create a method:
class Page extends SiteTree {
...
public function hasExpired() {
return (strtotime($this->Date) < time());
}
}
Now, in your template you can do:
<% if hasExpired %>
...
<% end_if %>
Obviously 'Date' will have to be declared in the $db array with date type
I hope that helps