Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: Date Handling in Perl

by fishmonger (Pilgrim)
on Jul 11, 2012 at 16:23 UTC ( #981185=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Date Handling in Perl
in thread Date Handling in Perl

That is using the ternary operator to set the amount of time we want to subtract when creating the datestamp. You can read up on the ternary operator in 'perldoc perlop'.

36000 is the number of seconds in 10 hours. Another monk used 60*60*24 which == 86400 and is the number of seconds in 24 hours.

I was going to use the 86400 value, but in this case 36000 should be sufficient to roll the datestamp back to the previous day. If the hour is grater than 10, then there's no need to adjust the datestamp, so $minus is set to 0.


Comment on Re^3: Date Handling in Perl

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2014-07-28 10:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (196 votes), past polls