Hi all,

How can I convert a long date-string into a TdateTime ?

I use the code as listed below. It falls over on the function strToDate().
It doesn't like a date '25-Apr-00' but is happy with '25-04-00'.
Why is that?
Don't dateTimeToStr() and strToDate() use the same date/time formatting
variables?

I want to convert a date string to a TdateTime, e.g. strToDate(s) where s =
'25-Apr-00');

Thanks for any help.


var
  tDate : TdateTime;

begin
  shortDateFormat := 'dd-mmm-yy';
  dateSeperator := '-';

  sDate := dateTimeToStr(now);  // returning e.g. '25-Apr-00'

  tDate := strToDate(sDate);       // fails !!!
end;




John Christenhusz
C/- Post Office
PUHOI - 1240
Phone:  09-422.0601
Mobile: 021-johnch (021-564624)
E-mail: [EMAIL PROTECTED]


winmail.dat

Reply via email to