use strict; use warnings; use POSIX qw(mktime); for my $t () { # Handle time, this is stored as a 'Candle' timestamp # "CYYMMDDhhmmssSSS" where C is the century (0 for 20th, 1 for 21st, etc). chomp ($t); print $t; my @bits = split //, $t; # use these later # This is how I convert it to human readable now my $c=substr $t,1,1,''; # grab the century substr $t, 2,0,'-';substr $t, 5,0,'-';substr $t, 8,0,' '; # do the date substr $t,11,0,':';substr $t,14,0,':';substr $t,17,0,'.'; # do the time $t = 19+$c.$t; # add back the century print " = $t\n"; # This is what I am thinking to go to epoch seconds # of course I would grab my human version from here too my $C = $bits[0] + 19; my $Y = $C . (join "", @bits[ 1,2]); my $M = join "", @bits[ 3,4 ]; my $D = join "", @bits[ 5,6 ]; my $h = join "", @bits[ 7,8 ]; my $m = join "", @bits[ 9,10]; my $s = join "", @bits[11,12]; print "c:$C y:$Y M:$M D:$D h:$h m:$m s:$s\n"; my $epoch = mktime($s, $m, $h, $D, $M-1, $Y-1900,); print scalar localtime $epoch; print $/; } __DATA__ 1130508154533613 1130508160033800 1130508161534113 1130508163034519 1130508164535019 1130508164535019 1130508170035191 1130508171533160 1130508173033660 1130508174534097 1130508180034535 1130424070116695 1130425070118790 1130426070118834 1130427070122888 1130428070123115 1130429070126161 1130430070127538 1130501070128195 1130502070131210 1130503070131969 1130504070135198