Board index » delphi » date comparison and format

date comparison and format

Hello, I'd like to add an expiration date to my application but it works on
a computer but not on another one. I assume it's because the date formats
are different. How can I go over this problem without changing the date
format of users?
I have something like this:
if (DateToStr(Date()) <  "08-01-2002")
I would prefer the international date format also: YYYY-MM-DD
Thanks,
Y Geoy
 

Re:date comparison and format


Sorry, I didn't want to post it here!

Quote
"Y Geoy" <yg...@hotmail.com> wrote in message news:3cbef925_2@dnews...
> Hello, I'd like to add an expiration date to my application but it works
on
> a computer but not on another one. I assume it's because the date formats
> are different. How can I go over this problem without changing the date
> format of users?
> I have something like this:
> if (DateToStr(Date()) <  "08-01-2002")
> I would prefer the international date format also: YYYY-MM-DD
> Thanks,
> Y Geoy

Re:date comparison and format


Quote
"Y Geoy" <yg...@hotmail.com> wrote:
>Hello, I'd like to add an expiration date to my application but it works on
>a computer but not on another one. I assume it's because the date formats
>are different. How can I go over this problem without changing the date
>format of users?
>I have something like this:
>if (DateToStr(Date()) <  "08-01-2002")
>I would prefer the international date format also: YYYY-MM-DD
>Thanks,
>Y Geoy

Hi,
don'nt compare strings in this case, put your Date in a dateclass
and compare the dateclass (no datformat problems anymore)

Dietmar

Other Threads