Skip to content

Instantly share code, notes, and snippets.

@sit
Created March 22, 2009 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sit/83180 to your computer and use it in GitHub Desktop.
Save sit/83180 to your computer and use it in GitHub Desktop.
Simple Perl script to convert unix epoch times to text.
#!/usr/bin/perl -w
#
# Convert unix times (on command line or one-per-line via stdin)
# to human readable times in local timezone.
#
if (@ARGV) {
print join("\n", map { scalar localtime($_); } @ARGV), "\n";
} else {
while (<STDIN>) {
chomp;
print scalar localtime $_, "\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment