Reputation: 1150
i am using vb.net. and I want how to display next six days date from current date.
lblDate.Text = System.DateTime.Now.ToString("dd MMMM yyyy")
This code display the current date.
Upvotes: 2
Views: 16194
Reputation: 11233
You can use AddDays
method to advance days of current date and String.Format to format it. Something like this:
lblDate.Text = String.Format("{0:dd MMMM yyyy}", Now.AddDays(6))
You can also use some other methods of DateTime like AddHours, AddMinutes etc, but here best fit is to use AddDays
Upvotes: 4
Reputation: 1010
dim 6DaysFromNow = Now.AddDays(6).ToString("dd MMMM yyyy")
Upvotes: 0
Reputation: 5588
lblDate.Text = System.DateTime.Now.AddDays(6).ToString("dd MMMM yyyy")
Upvotes: 1
Reputation: 2023
dim sixDaysfromNow as DateTime = Now.AddDays(6)
Reference: http://msdn.microsoft.com/en-us/library/system.datetime.adddays.aspx
Upvotes: 3