Solved

Checking if today is the first Monday of the month

Posted on 2004-08-02
3
321 Views
Last Modified: 2012-05-05
I would like to create a script that would run every Monday and check if today is first Monday of the month.  If it is, then continue with the execution. If it isn't then exit.  Any ideas?
0
Comment
Question by:Dmitriy
  • 2
3 Comments
 
LVL 14

Expert Comment

by:dfu23
Comment Utility
well ... i'll assume you can schedul this with whatever ... like Window's Scheduler ...

set a scheduled task for a certain time to run on every Monday ...
the task would run the script which could handle checking if was the first Monday ...

i'm not extremely familiar with Perl but I think that you could then create a variable in the script with the current date ...
from that you could extract the current day and use that in a conditional

if (day <= 7)
  continue execution
else
  exit script
0
 

Accepted Solution

by:
permanentE earned 50 total points
Comment Utility
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =localtime(time);
if ($wday==1 && $mday <=7) {

    ....

}
0
 
LVL 14

Expert Comment

by:dfu23
Comment Utility
man i wish i knew perl better :(
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now