lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


If your date is represented in the yyyy/mm/dd format, instead of
dd/mm/yyyy, you can just compare it with os.date("%Y/%m/%d").

if (os.date("%Y/%m/%d") < myDate) then
   print "myDate is the future";
end

 - yuri

On Wed, May 6, 2009 at 10:33 AM, Diego - Red Baires
<diego_redbaires@hotmail.com> wrote:
>
> hi again guys,
> i cant find information regarding the comparision of dates and times.
> myDate = "05/21/2009";
> if ( os.date()> myDate) then
>   print "myDate is a previuos date";
> if ( os.date() = myDate) then
>   print "myDate is today";
> if ( os.date() < myDate) then
>   print "myDate is in the future";
>
>
>
> is this correct ?
> will this work to all locales ?
> what about comparing times ? (i mean, if a time is between two values)
> thanks one more time
>
> ________________________________
> Windows Live™: Keep your life in sync. Check it out!



-- 
http://spu.tnik.org/