This function returns a string representing the date of last modify relative to file_name
according to the format described by format_string
.
Both file_name
and format_string
can be any valid expression:
fdate ("file_name", "format_string");
fdate (variable_storing_file, variable_storing_format);
fdate ("file_name", variable_storing_format);
fdate (variable_storing_file, "format_string");
It simply returns format_string
interpreting the
following sequences:
current year (1972 ...)
month (1..12)
day of month ( 1..31)
full month name (January..December)
full weekday name (Sunday..Saturday)
hour
minutes
seconds
Full month names and full weekday names are stored in arrays _months
[ ] and _days
[ ]; you can
simply override these variables in order to change the names. As an example, if your site
is written in Italian, you can place this definition in a file and include it everywhere
you need:
_months [ ] = { "Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre" }; _days [ ] = { "Domenica", "Lunedi", "Martedi", "Mercoledi", "Giovedi", "Venerdi", "Sabato" };
Important: if you use Cows-mkgen
to create makefiles, file_name
can only be provided as a
string constant (e.g. "foo.ps") or via the inputfile ()
and outputfile ()
functions; otherwise, Cows-mkgen will miss the dependency and raise a warning. Of course,
Cows will correctly display file date, since it can handle complex expressions, but if
the file is changed, make won't update output file. For further informations see Section 24.1.
Assuming manual.ps was updated on the first day of December 2002,
echo (fdate ("manual.ps", "(#D, #d #M #y)"));
will display:
(Friday, 1 December 2002)
This manual can be downloaded from http://www.g-cows.org/.