Jan 13, 2003 #1 inetd Technical User Joined Jan 23, 2002 Messages 115 Location 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 Joined Jan 6, 2003 Messages 268 Location 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 Joined Jan 6, 2003 Messages 268 Location RO just try date +"%Y-%m-%d" -d"90 days ago" Upvote 0 Downvote