Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Determining if I have a particular Friday off

by RedElk (Hermit)
on Oct 24, 2012 at 18:39 UTC ( #1000685=note: print w/ replies, xml ) Need Help??


in reply to Re: Determining if I have a particular Friday off
in thread Determining if I have a particular Friday off

Is it true that this is telling me whether or not I work the Friday of this week? If so, it worked for me. However, I did have to swap "free/work".

How does dividing the $yday by 7 with remainder of 2 get one to a Friday - or did I misunderstand?

UPDATE: Ah, it provides the odd even week.


Comment on Re^2: Determining if I have a particular Friday off
Download Code
Re^3: Determining if I have a particular Friday off
by thmsdrew (Scribe) on Oct 24, 2012 at 19:15 UTC

    I am generally aware of my schedule for the current week, so this isn't particularly helpful. (I need to know if I'm working the current week's Friday so I can record my time properly!)

      Yeah, I concur. But, FWIW it was easy to extend for a minimal forecast:


      #! usr/local/bin/perl # rdo.pl use strict; use warnings; print +(localtime)[7] / 7 % 2 ? "This Friday: Work\n" : "This Friday: +Free\n"; print +(localtime)[7] +1 / 7 % 2 ? "Next Friday: Work\n" : "Next Frida +y: Free\n"; print +((localtime)[7] +2) / 7 % 2 ? "Friday the week after: Work\n" : + "Friday the week after: Free\n";

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (10)
As of 2014-07-25 21:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (175 votes), past polls