Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Contract Countdown

by frankus (Priest)
on Jan 13, 2003 at 12:56 UTC ( #226445=obfuscated: print w/ replies, xml ) Need Help??

Not obfuscation, just quirky.
Sometimes working in a compendium of Dilbert cartoons can be depressing.
At times like this I find it is a worthwhile experience to start wishing your life away, hell what's 100 days.
#!/usr/local/bin/perl use Time::Local; for($_=time;$_<timelocal(0,0,0,(split/\//,$ARGV[0])[0..2])+86400;$_+=8 +6400){ @_=localtime($_);$;++unless$_[6]==6||$_[6]==0}print"$; working days le +ft.\n"
It's run from a cron script on the server with a date argument (DD/MM/YYYY) output redirected to my .plan file :^).
It tells me how many working days I have left in this contract,
I figure by the time my manager's figured out what this code does, Dr Zaius will be squeezing into 54" waist Lederhosen.

I wouldn't recommend using this algolrithm to find the number of working days between two points as it doesn't scale very well.

Gagh I got bored:

#!/usr/local/bin/perl use Time::Local;$,+=(localtime($^T+=86400))[60]!~/[60]/while$^T-86400 <timelocal 0,0,0,split'/',$ARGV[0];print''," working days left\n"#:^)

--

Brother Frankus.

¤

Comment on Contract Countdown
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2014-07-30 22:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (241 votes), past polls