&date(日付取得)
基本構造へ戻る
######################################################
# 日付セット#
######################################################
#
#
sub date{
$times = shift;
if (!$times) { $ENV{'TZ'} = "JST-9"; $times = time; }
($sec,$min,$hour,$mday,$mon,$year,$wday) = (localtime($times))[0..6];
@week = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
# 日時のフォーマット
$date_r = sprintf("%04d/%02d/%02d(%s) %02d:%02d",
$year+1900,$mon+1,$mday,$wk[$wday],$hour,$min);
$week = ("日","月","火","水","木","金","土")[$wday];
$mon++;
$year += 1900;
$date = "$year年$mon月$mday日";
$date1 = "$mon";
$date2 = "$mday";
$pdate = "$year";
$pdate1 = "$mon";
$pdate2 = "$mday";
}
#
#
######################################################