Re: Can u answer for strange problem??
"custom_soft_sol" <[email protected]>
| Newsgroups | gmane.comp.lang.delphi.programming |
|---|---|
| Message-ID | <[email protected]> |
Hi.
You are still using the StrToDateTime, which is dependent on the
regional settings and could cause errors.
Do you know what format the date is going to be entered in?
If you do then try something like the following
if (s = FormatDateTime('dd/mm/yyyy',EncodeDate(1,1,2002))) then
showmessage('Valid');
This will check if the entered date = 01/01/2002. Is there a reason
why you are passing through a string for the original date? Why not
use some sort of date picker or date edit, that would solve all your
problems.
If you can give me some more details of what you are trying to do
then I can help you out better.
--- In [email protected], "cstakdk" <cstakdk@y...>
wrote:
> hi..
> it is 4 digit and i tried like this
> begin
> s:= Edit1.text;
>
> if FormatDateTime('dd,mm,yyyy',StrToDateTime(s)) = FormatDateTime
> ('dd,mm,yyyy',StrToDateTime('01/01/0001')) then
> ShowMessage(' Valid Date');
>
> end;
>
> still it giving the same problem
>
>
> --- In [email protected], "Andrew Muir"
> <armuir@b...> wrote:
> > Is your regional settings on your pc set to 2 digit years ?
> > ----- Original Message -----
> > From: cstakdk
> > To: [email protected]
> > Sent: Friday, July 25, 2003 5:15 PM
> > Subject: [Delphi] Can u answer for strange problem??
> >
> >
> > Please execute this code
> >
> > if StrToDate(Edit1.Text) = StrToDate('01/01/0001') then
> > begin
> > ShowMessage('Valid Date');
> > end;
> >
> > give a value to the edit box 01/01/0001
> >
> > You will get the message 'Valid Date'
> >
> > give a value to the edit box 01/01/2001
> >
> > Again you will get the message 'Valid Date'.
> >
> > Strange for me... anything wroning in this code
> >
> > cstakdk
> >
> >
> >
> > Yahoo! Groups Sponsor
> > ADVERTISEMENT
> >
> >
> >
> >
> > CodeCoffer - new Delphi code protection Tool!
> > http://www.delphicollection.com/public/CodeCoffer.htm
> > ---------------------------------------------------------------
> > Unsubscribe:[email protected]
> > List owner:[email protected]
> > ---------------------------------------------------------------
> >
> > Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service.
> >
> >
> >
> > [Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Free shipping on all inkjet cartridge & refill kit orders to US & Canada. Low prices up to 80% off. We have your brand: HP, Epson, Lexmark & more.
http://www.c1tracking.com/l.asp?cid=5510
http://us.click.yahoo.com/GHXcIA/n.WGAA/ySSFAA/i7folB/TM
---------------------------------------------------------------------~->
CodeCoffer - new Delphi code protection Tool!
http://www.delphicollection.com/public/CodeCoffer.htm
---------------------------------------------------------------
Unsubscribe:[email protected]
List owner:[email protected]
---------------------------------------------------------------
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/