in reply to date and time using localtime

The exact meaning of strftime formats can be complicated. The documentation for POSIX helps you to refer to the appropriate documentation for your case. Your examples are rather simple. The documentation for any C or C++ library would be good enough.
#!/usr/bin/perl -w use strict; use warnings; use POSIX; my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(ti +me); $year += 1900; print "$sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst\n"; my $now_string = localtime; print "$now_string\n"; #my $date = strftime "%a %b %e %H:%M:%S %Y", localtime; my $date = strftime "%d-%b-%Y", localtime; print "Date1 is : $date\n"; #$date = strftime "%a-%B-%e", localtime; $date = strftime "%d-%m-%Y", localtime; print "Date2 is : $date\n"; my $time = strftime "%H:%M:%S", localtime; print "Time1 is : $time\n"; #my $time1 = strftime "%h:%m:%s", localtime; my $time1 = strftime "%I:%M:%S", localtime; print "Time2 is : $time1\n"; OUTPUT: 58, 39, 15, 6, 9, 2017, 5, 278, 1 Fri Oct 6 15:39:58 2017 Date1 is : 06-Oct-2017 Date2 is : 06-10-2017 Time1 is : 15:39:58 Time2 is : 03:39:58
Bill