I have a script that I've been writing that automates weekly data retrieval. I've been using
Date::Calc's Week_of_Year function to determine that it's time to retreive data. My problem is that the data's week ends on Saturday but Week_of_Year ends on Sunday, therefore if data are recieved on Sunday it continues looking for data even though the data have already been retrieved.
Earlier today I asked this question in the cb, but unfortunately the suggested "%U" in strftime does not work the same as Week_of_Year.
print strftime("WEEK Number%n%U%n%nYear%n%Y", 1,1,1,31,11,103)
WEEK Number
52
Year
2003
printf "Week Number\n%d\n\nYear\n%d", Week_of_Year(2003,12,31)
Week Number
1
Year
2004
Does anyone know how to use an offset or have any suggestions for a work around?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.