このブログを検索

2011/05/24

カレンダー

#($sec,$min,$hour,$mday,$month,$year,$wday,$stime) = localtime($times);
sub get_time(){
my ($t) = @_;
@a  =  localtime ( $t );
}

print $now = localtime;

@weekday = qw /Sun Mon Tue Wed Thu Fri Sat/;

print "<table border=1><tr>";
foreach(@weekday){
print "<td>$_<\/td>";
}
print "<\/tr>";


@b = &get_time(time);

$d = (@b[6] + 7) * -1;

for($i=0;$i<3;$i++){
print "<tr>";
for($j=0;$j<7;$j++){
@b = &get_time(time + $d * 24 * 3600);
$print_date = sprintf("%2d/%2d ",@b[4]+1,@b[3]);
print "<td>";
if($d == 0){
print "<b>";
print $print_date;
print "<\/b>";
}else{
print $print_date;
}
print "<\/d>";
$d++;
}
print "<\/tr>\n";
}

print "<\/tr><\/table>";