![]() |
|
XP is just a number | |
PerlMonks |
comment on |
( #3333=superdoc: print w/replies, xml ) | Need Help?? |
How do you define a business day? Is it weekdays? Or do you need to take into account public holidays and things like that? Here's a naive approach that just leaves you needing to define an is_business_day() subroutine which takes a time (as an epoch seconds value) as an argument.
Update: As ikegami correctly points out below, there's a potential bug in this program if it's run across days that don't contain 24 hours (i.e. when switching to or from daylight saving time). The fix is to normalise the time to noon (assuming that timezone changes always occur overnight). This change is left as an exercise for the reader.
-- "The first rule of Perl club is you do not talk about Perl club." -- Chip Salzenberg In reply to Re: Date Calculation
by davorg
|
|