tags:

views:

110

answers:

2

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?

A: 

I ended up doing the following. Inelegant, but it works:

  if (_system.date().char[1..2] >= 01 and _system.date().char[4..5] >= 01 and _system.date().char[7..10] >= 2010) then
    alert("Your license has expired. Please contact the Company to renew your license.")
    _player.quit()
  end if

It does the trick, but I would still be interested in alternative methods of doing this.

Elie
+1  A: 

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

luna1999