Mercurial > mercurial > hgweb_porori.cgi
view Porori/src2/porori.pl @ 0:2b4fc52a96d9
porori.
author | pyon@macmini |
---|---|
date | Wed, 12 Feb 2020 18:57:24 +0900 |
parents | |
children |
line wrap: on
line source
use Time::Piece; use Time::Seconds; my $today = localtime->ymd; $today =~ s/-//g; print join ',' => "被保番", "氏名", "申請日", "区分", "開始日", "終了日", "期間", "\n"; while (<>) { chomp; my ($h, $n, $s, $kbn, $d, $bgn, $end) = split /,/; next if $d ne $today; $kbn = "新規" if $kbn eq '01'; $kbn = "更新" if $kbn eq '02'; $kbn = "支介" if $kbn eq '10'; $kbn = "区変" if $kbn eq '05'; my $tbgn = Time::Piece->strptime($bgn, "%Y%m%d"); my $tend = Time::Piece->strptime($end, "%Y%m%d"); my $diff = $tend - $tbgn; print join ',' => $h, $n, $s, $kbn, $bgn, $end, int $diff->months(); print "\n"; }