Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Candle Time

by Anonymous Monk
on May 16, 2013 at 14:12 UTC ( [id://1033837]=note: print w/replies, xml ) Need Help??


in reply to Candle Time

 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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1033837]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-26 03:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found