Perlコーディング
現在日時の求め方
2007年11月24日
     
     
       現在日時を取得するときは、
use POSIX 'strftime';
$now = strftime "%Y/%m/%d %H:%M:%S", localtime;
なら 2007/11/24 22:10:00 の書式で返されます。
use POSIX 'strftime';
$now = strftime "%Y%m%d", localtime;
なら 20071124、
use POSIX 'strftime';
$now = strftime "%y%m%d", localtime;
なら 071124
となります。
       
       
        
       
       
     
     
    use POSIX 'strftime';
$now = strftime "%Y/%m/%d %H:%M:%S", localtime;
なら 2007/11/24 22:10:00 の書式で返されます。
use POSIX 'strftime';
$now = strftime "%Y%m%d", localtime;
なら 20071124、
use POSIX 'strftime';
$now = strftime "%y%m%d", localtime;
なら 071124
となります。
     コメント