Created
October 22, 2012 07:02
-
-
Save xtetsuji/3930052 to your computer and use it in GitHub Desktop.
Dump timetable of September 2012 by UTF-8 Japanese format.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/perl | |
| # Dump timetable of September 2012 by UTF-8 Japanese format. | |
| use strict; | |
| use warnings; | |
| use utf8; | |
| use Time::Piece; | |
| use Time::Seconds; | |
| binmode STDOUT, ':utf8'; | |
| my @week_ja = qw(日 月 火 水 木 金 土); | |
| my %is_holiday_of = map { $_ => 1 } qw(3 23); | |
| my $day = Time::Piece->strptime("2012/11/01", '%Y/%m/%d'); | |
| for( ; $day->mon == 11 ; $day += ONE_DAY ) { | |
| printf "%s(%s)\n", $day->ymd("/"), @week_ja[$day->day_of_week] . ($is_holiday_of{$day->mday} ? ',祝' : ''); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment