Jan 13, 2003 #1 inetd Technical User Jan 23, 2002 115 HK I want to write a shell script to get the date before 90 days. How can I do it? I would like to have the yyyy-mm-dd format. Anyone knows how to do it? Thanks.
I want to write a shell script to get the date before 90 days. How can I do it? I would like to have the yyyy-mm-dd format. Anyone knows how to do it? Thanks.
Jan 13, 2003 1 #2 predamarcel IS-IT--Management Jan 6, 2003 268 RO hi, just try #!/usr/bin/perl @old_date=localtime(time()-90*24*60*60); $old_date[5]+=1900; print $old_date[5]." - ".$old_date[4]." - ".$old_date[3]; read time() and localtime() functions manual PM Upvote 0 Downvote
hi, just try #!/usr/bin/perl @old_date=localtime(time()-90*24*60*60); $old_date[5]+=1900; print $old_date[5]." - ".$old_date[4]." - ".$old_date[3]; read time() and localtime() functions manual PM
Jan 13, 2003 #3 predamarcel IS-IT--Management Jan 6, 2003 268 RO just try date +"%Y-%m-%d" -d"90 days ago" Upvote 0 Downvote