SHARE
TWEET

Untitled

a guest Aug 17th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/perl
  2.  
  3. # ローカル時刻の取得
  4. ($sec, $min, $hour, $day, $mon, $year, $wday) = localtime; # ローカル時刻の各種値をリストで受け取る.
  5. $yearstr = $year + 1900; # 1900を足すことで$yearの文字列版$yearstrをセット.
  6. $monstr = $mon + 1; # 1を足すことで$monの文字列版$monstrをセット.
  7. $wdaystr = ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat")[$wday]; # リストの添字を使って$wdayの文字列版$wdaystrをセット.
  8. print "$yearstr/$monstr/$day $hour:$min:$sec ($wdaystr)\n"; # ローカル時刻文字列の出力.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top