On Sun, 25 Feb 2007, Pieter Valentijn wrote:

> Should be easy.
> 
> Function MyStrToDate(Astr : String) : TDateTime ;
> Begin
>  Astr := StringReplace(Astr,'-',DateSeparator,[rfReplaceAll]);
>  Astr := StringReplace(Astr,'/',DateSeparator,[rfReplaceAll]);
>  result := StrTodate(Astr);
> End;
> 
> This should work on anny string with anny format.

Except in Belgium, where the official date separator is a space, 
so I'd get a string like '2007 02 27'. 

You should always simply set the date separator char to the correct value.

Michael.

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to