Date::Holidays::PT v.0.02

Advertisement
Advertisement

Date::Holidays::PT - Determine Portuguese public holidaysSYNOPSIS use Date::Holidays::PT; my ($year, $month, $day) = (localtime)[ 5, 4, 3 ]; $year += 1900; $month += 1; print "Woohoo" if is_pt_holiday( $year, $month, $day ); my $h = pt_holidays($year); printf "Jan. 1st is named '%s'", $h->{'0101'};FUNCTIONSnewCreates a new Date::Holidays::PT object. my $mh = Date::Holidays::PT->new();is_holidayShould at least take three arguments:year (four digits) month (between 1-12) day (between 1-31)The return value from is_holiday is either a 1 or a 0 (1 if the specified date is a holiday, 0 otherwise). if ( $mh->is_holiday( $year, $month, $day ) ) { # it's a holiday }is_pt_holidaySimilar to is_holiday, but instead of returning 1 if the date is a holiday returns a string comprising the name of the holidays. In the event of two or more holidays on the same day (hey, it happens), the string will comprise the name of all those holidays separated by a semicolon. my $todays_holiday = $mh->is_pt_holiday( $year, $month, $day ); if ( $todays_holiday ) { print "Today is $todays_holiday.Don't bother getting up!"; }holidaysShould take at least one argument:year (four digits)Returns a reference to a hash, where the keys are date represented as four digits, the two first representing month (01-12) and the last two representing day (01-31).The value for the key in question is the local name for the holiday indicated by the day. In the event of two or more holidays on the same day (yes, it happens!), the values will comprise the name of all those holidays separated by a semicolon. my $years_holidays = holidays( $year ); for (keys %$years_holidays) { my ($day, $month) = /(..)(..)/; print "$day/$month - $years_holidays->$_"; }

Date::Holidays::PT - Determine Portuguese ... Determine Portuguese public holidays ...

 
  • Freeware
  • 10 Kb
  • 135
  • Free
 
 

Review Date::Holidays::PT

  • captcha
 
 
New Miscellaneous software
  • SocialMedia driven App Developer  v.3.08If you could look 1 year ahead, would you want to see? The SocialMedia driven App Developer is calculating your Shareware's Success. Fine-tune as many cost-driving parameters as you want. See revenue and net profit results displayed over 48 months.
  • Bersoft HTML Print  v.9.09This programmer utility for printing HTML pages and images in an invisible way can be called from your application, passing either the file to print or a file list as a parameter.
  • Metamill  v.8.2.2022Metamill is a professional UML modeling tool. Supports UML 2.4 standard. All 14 UML diagrams supported. Round-trip engineering for Python, ADA, Java, C, C++, C# and VB.Net. RTF and HTML document generation. Fast and easy to use. www.metamill.com ...
  • RunETAC  v.2-0.1-6-enaThe ETAC programming language is a general purpose dictionary and stack based interpreted script programming language fully capable of traditional high-level block structured language style syntax.
  • Libacr  v.0.7.2libACR is an open source Python content management system library for Turbogears ...
  • Devel::CheckOS  v.1.61Check what OS we're running on ...