How about using the FormatDateTime function.

eg: Filename :=
FormatDateTime('"File"mmyyyy".txt"',StrToDate(Maskedit1.Text)); 
This will give you File062000.txt.

Cheers,
Scott Cree
Knowlysis Limited

> -----Original Message-----
> From: Eion McIntosh (CHCH) [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, 11 July 2000 16:23
> To:   Multiple recipients of list delphi
> Subject:      [DUG]:  ShortDateFormat
> 
> Hi
> 
> I have a user who uses an edit field to enter a date in the format
> dd/mm/yyyy.
> 
> I have to convert this to a ddmm text field and doing the following
> works find.
> 
>     Shortdateformat := 'ddmm';
>     Filename := 'File' + datetostr(strtodate(Maskedit1.text)) + '.txt'; 
>  
> This gives me the result FILE3006.txt
> 
> The problem is that if I change the shortdateformat to mmyyyy or mmmyyyy
> the convert fails with an exception saying invalid date format. Why will
> it convert 30/06/2000 to 3006 and not give me either 062000 or Jun2000?
> 
> Thanks
> Eion McIntosh
> PPCS Ltd
> 
> --------------------------------------------------------------------------
> -
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to