Description :
Voici un exemple de code pour afficher la date du jour en Perl.
ici je ne retourne que la date, mais vous pouvez également afficher l'heure, minute etc...
Portion de code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
#!/usr/bin/perl
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); my $dateUs = ($mon+1)."/".$mday."/".(1900+$year); print "nous sommes le ",$dateUs;
/* ------ pour information ----- */ /* seconds (0 - 59) */ /* minutes (0 - 59) */ /* hours (0 - 23) */ /* day of month (1 - 31) */ /* month of year (0 - 11) */ /* year - 1900 */ /* day of week (Sunday = 0) */ /* day of year (0 - 365) */
|
|