Created
June 30, 2014 14:06
-
-
Save stevelippert/5ff4eef26450b010d0f3 to your computer and use it in GitHub Desktop.
getUTCTimestamp: A subroutine to return an epoch time stamp for UTC time.
This file contains hidden or 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
| sub getUTCTimestamp { | |
| my ($localTime, @t, $offset); | |
| $localTime = time; | |
| @t = localtime(time); | |
| $offset = timegm(@t) - timelocal(@t); | |
| $offset =~ s/\-//g; | |
| return ($localTime + $offset); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment