The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
comparing files - adding/subtracting/formating columns oabdalla Shell Programming and Scripting 7 06-13-2008 12:20 AM
Subtracting date / timestamps roadcyclist Shell Programming and Scripting 0 06-21-2006 11:51 AM
subtracting a days from current date rameshspal Shell Programming and Scripting 1 03-09-2006 10:18 PM
Date two days ago markhughes04 Shell Programming and Scripting 7 06-14-2005 11:48 AM
Subtracting Two months from date jwatson12 UNIX for Dummies Questions & Answers 3 09-13-2002 10:06 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-19-2008
Registered User
 

Join Date: May 2008
Posts: 9
adding or subtracting days in the o/p of date

how can we add or subtract days from the output of date command in unix...

like if i want to subtract a day from the result of date command like this..
v_date=`date +%Y%m%d`
this wud give me 20080519
now i want to subtract one day from this.. so tht it wud give me 20080518..

how do i do this??

also if i want to put a cond if its a thursday then sub 3 days from the date.. so tht it gives me monday's date..

how to do this???
Reply With Quote
Forum Sponsor
  #2  
Old 05-19-2008
Moderator
 

Join Date: Feb 2007
Posts: 2,328
A useful link:

Yesterdays Date/Date Arithmetic

Regards
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 07:31 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0