FileDate

Description:

baFileDate returns the date of a file as a string.

Platforms:

Windows and Macintosh

Usage:

Result = baFileDate( FileName , DateFormat , TimeFormat )

Arguments:

String, string, string.
FileName is the file to get the date of.
DateFormat is the desired format of the date,
TimeFormat is the desired format of the time.

Returns:

String.
Returns the date of the file, or an empty string if the file doesn't exist.

Examples:

Director:
date = baFileDate( "c:\data\student.dat" , "dd-mm-yy" , "hh:nn:ss" )

Authorware:
date := baFileDate( "c:\\data\\student.dat" , "dd-mm-yy" , "hh:nn:ss" )
 

Notes:

The date format can consist of "d" for day, "m" for month, "y" for year.

The time format can consist of "h" for hours, "n" for minutes, "s" for seconds. (Note the "n" for minutes.)

A single letter ("d") returns the exact number eg "5".

A double letter ("dd") returns the number with a leading zero if required eg "05".

A triple letter ("ddd") returns the short name eg "Mon".

A quad letter ("dddd") returns the full name eg "Monday".

Any letters other than those listed above will returned as is - they can be used for separators eg "dd-mm-yy" returns "05-11-97"; "d mmmm, yyyy" returns "5 November, 1997"

If the format is an empty string, then the date or time will not be returned.
 

See also:

baFileDateEx
baSetFileDate
baFileAge
baFileVersion