I need to calculate dates based on distance in days and also months from today. I need to return it in the format mm/dd/yyyy. Using VBScript’s DateDiff function you can only get the distance in days (or months, or minutes, or years, I know) from a date. So of course you can clumsily piece together a timestamp knowing all these. Is there a more efficient way of calculating the timestamp of a day 7 days ago? 1 month ago? Thanks!
Share
Do not use
DateDiff, butDateAddto add date to today. Then use a dotnetStringBuilderto easily format your date (works better than building your own format functions and you are more flexible):