my $Y = $C . (join "", @bits[ 1,2]);  ... $Y-1900,

Well, that seems wrong, if $Y is first 3 chars, just get it that way , no need for append/add/subtract..

Also,

1130508154533613 = 2013-05-08 15:45:33.613 c:20 y:2013 M:05 D:08 h:15 m:45 s:33 Wed May 8 15:45:33 2013
If your year isn't 4 digits, are you sure your month is off-by-one?

I get

#!/usr/bin/perl -- use strict; use warnings; Fudge('1130508154533613'); sub Fudge { use POSIX(); my( $Y , $M, $D, $h, $m, $s , $ms ) = $_[-1] =~ m{^(.{3})(..)(..)( +..)(..)(..)(...)$}; my $epoch = POSIX::mktime( $s, $m, $h, $D, $M, $Y, -1, -1, -1 ); print "$epoch = ", POSIX::strftime('%Y-%m-%d %H:%M:%S', $s, $m, $h, $D, $M, $Y, - +1, -1, -1 ), ".$ms" , $/; print scalar localtime $epoch; print $/; } __END__ 1370731533 = 2013-06-08 15:45:33.613 Sat Jun 8 15:45:33 2013

In reply to Re: Candle Time by Anonymous Monk
in thread Candle Time by Random_Walk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.