C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » General »

How to subtract n days from a date.


Posted Date: 12 Apr 2004    Resource Type: Articles    Category: General
Author: ManojRajanMember Level: Gold    
Rating: 1 out of 5Points: 4




Dim Dt as date
dt = date.today

dt.adddays(-2) 'This code will subtract two days from the current date

msgbox dt

OR

Dim dt As Date
Dim ts As TimeSpan

dt = Date.Today
dt = dt.Add(ts.FromDays(-2))
msgbox dt

The timespan will return the time unit, here the unit is day.




Responses

Author: shyamala shanker    06 Jul 2004Member Level: Bronze   Points : 0
Thanks manoj for the information


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Model View Controller (MVC ) Architecture
Previous Resource: How to get months name from month digit?
Return to Discussion Resource Index
Post New Resource
Category: General


Post resources and earn money!
 
Related Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use