Created
November 28, 2011 08:32
-
-
Save numberwhun/1399621 to your computer and use it in GitHub Desktop.
Time Stamp Code - Perl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Some code for creating timestamps | |
@months = qw(01 02 03 04 05 06 07 08 09 10 11 12); | |
@weekDays = qw(01 02 03 04 05 06 07); | |
($second, $minute, $hour, $dayOfMonth, $month, $yearOffset, $dayOfWeek, $dayOfYear, $daylightSavings) = localtime(); | |
$year = 1900 + $yearOffset; | |
$theTime = "$hour:$minute:$second, $weekDays[$dayOfWeek] $months[$month] $dayOfMonth, $year"; | |
if ( $dayOfMonth > 9 ) | |
{ | |
$dt = $months[$month] . "/" . $dayOfMonth . "/" . $year; | |
$rundate = $year . $months[$month] . $dayOfMonth; | |
} | |
else | |
{ | |
$dt = $months[$month] . "/" . '0'.$dayOfMonth . "/" . $year; | |
$rundate = $year . $months[$month] . '0'.$dayOfMonth; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment