Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

6 months ago

Status
Not open for further replies.

rexxhead

Programmer
Jul 31, 2002
611
US
Does anyone have any tested code for computing the date 6 months ago? The problem I'm running into is that 6 months before Aug 31st is February 31st.

Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Depends what you want to work out - if you want 6 months in terms of 180 days ago, or 6 months in terms of 183 days ago (if you know what I mean). What I always do is convert the date to a base date, subtract the estimated number then convert back to a normal format.

If you wanted to be more accurate you'd calculate what months you went back and the number of days in them, then subtract from the base date.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top