summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xunixtime.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/unixtime.pl b/unixtime.pl
index d6fff26..e75a786 100755
--- a/unixtime.pl
+++ b/unixtime.pl
@@ -12,8 +12,8 @@ if (@ARGV eq 1) {
if (defined $args[0] and $args[0] ne "") {
if ($args[1] eq "ms") {
#Convert from timestamp in milliseconds to date
- $seconds = substr $args[0], 0, 10;
- $milliseconds = substr $args[0], 10, 3;
+ $seconds = substr $args[0], 0, -3;
+ $milliseconds = substr $args[0], -3;
$date = strftime('%a %b %e %H:%M:%S:' . $milliseconds . ' %Z %Y', localtime( $seconds ) ) . "\n";
print $date;
} elsif ($args[0] eq "ms") {