1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
implementation
{ TForm1 }
uses DateUtils;
-----------------------------
-----------------------------
procedure TForm1.Button1Click(Sender: TObject);
const jours: array[1..7] of string =
('Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi');
const mois: array[1..12] of string =
('Janvier', 'Fevrier', 'Mars', 'Avril', 'Mais', 'Juin', 'Juillet', 'Aout',
'Septembre', 'Octobre', 'Novembre', 'Decembre');
const jdmois: array[1..31] of string =
('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15',
'16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31');
var Datefr:TDateTime;
annees:string;
begin
Datefr:=now;
annees:=FormatDateTime('yyyy', now);
ShowMessage('Nous sommes le ' +
jours[DayOfWeek(Datefr)] + ' ' +
jdmois[DayOfTheMonth(Datefr)] + ' '+
mois[MonthOfTheYear(Datefr)] + ' ' +
annees);
end; |
Partager