datetimelingo

Comparing dates in Lingo


How do I compare two dates in Lingo? To be specific, I want to know if today's date is after some fixed date. I know I can create the fixed date by using:

date("20090101")

and I can get the current date using:

_system.date()

but I can't seem to directly compare the two. Do I have to parse the _system.date() to determine if it's after my fixed date? I tried:

if(_system.date() > date("20090101") then
    --do something
end if

but that doesn't seem to work. Any ideas?


Solution

  • Instead of _system.date(), try _movie.systemDate(), it will return a date object that you can safely compare with another one.

    if _movie.systemDate() > date("20090101") then

    --do something
    

    end if

    regards