Yesterday in Perl


/ Published in: Perl
Save to your folder(s)



Copy this code and paste it in your HTML
  1. #Method 1
  2. perl -e '@T=localtime(time-86400);printf("%2d/%2d/%4d\n",$T[4]+1,$T[3],$T[5]+1900)'
  3.  
  4. #Method 2
  5. perl -e 'use POSIX;print POSIX::strftime("%m/$d/%Y\n",localtime(time-86400))'

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.