programming-examples/perl/String/Output month name and week name by using the return value from gmtime.pl
2019-11-15 12:59:38 +01:00

20 lines
507 B
Raku

($sec, $min, $hour, $dom, $mon,$year, $wday, $yday, $isdst) = gmtime($time);
@months = ("January", "February",
"March", "April", "May",
"June", "July", "August",
"September", "October",
"November", "December");
@week = ("Sunday", "Monday", "Tuesday",
"Wednesday", "Thursday",
"Friday", "Saturday");
$year += 1900;
printf("Date is: %s, %d-%s-%d\n",
$week[$wday], $dom, $months[$mon],
$year);