|
-
May 22nd, 2006, 10:02 AM
#1
Thread Starter
Junior Member
[RESOLVED] sum days to a "datetime"
Hi,
How do I add days to a "datetime" type item?
For example, I have:
Dim m As DateTime = 12-05-2006
How do I add 5 days to this item, so that its content becomes 17-05-2006 ?
I tried to cast with an integer, but it's not possible.
-
May 22nd, 2006, 11:03 AM
#2
Re: sum days to a "datetime"
VB Code:
Dim m As New DateTime(2006, 12, 5)
MessageBox.Show(m.ToShortDateString)
m = m.AddDays(5)
MessageBox.Show(m.ToShortDateString)
-
May 22nd, 2006, 01:27 PM
#3
Thread Starter
Junior Member
Re: sum days to a "datetime"
excellent, thanks very much mate
-
May 22nd, 2006, 01:28 PM
#4
Re: sum days to a "datetime"
No problem, mark the thread resolved using the thread tools if this particular question has been answered.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|