($sec,$min,$hour,$mday,$month,$year,$wday,$yday,$isdst) = localtime($time);
if($wday==0){ # とか if($week[$wday] eq "Sun"){