Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: High-speed Date Formatting

by hdb (Prior)
on Jul 12, 2013 at 08:58 UTC ( #1043913=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $leaps =  int( ($y - 1970) / 4 + 0.5 );
        (((($y-1970)*365 +$leaps+MONTHS->{$m}+($d-1))*24 +$H)*60 +$M)*60 +
    +$S;
    
  2. or download this
    (((int(($y-1970)*365.25-.5)+MONTHS->{$m}+$d)*24 +$H)*60 +$M)*60 +$S;
    
  3. or download this
    sub str2epoch3 {
        (((int((substr($_[0],12,4)-1970)*365.25-.5)+
         MONTHS->{substr($_[0],8,3)}+substr($_[0],5,2))*24 +substr($_[0],1
    +7,2))*60 +
         substr($_[0],20,2))*60 +substr($_[0],23,2);
    }
    
  4. or download this
    use strict;
    use warnings;
    ...
                   substr    => sub { str2epoch3($str) }, }
        );
    </readmore>
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2014-10-23 13:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (125 votes), past polls