What is the output of below code?

Dim dt As Date = DateTime.Now.AddDays(-1)

 Posted by vishalneeraj-24503 on 12/24/2013 | Category: VB.NET Interview questions | Views: 3555 | Points: 40

It will show Yesterday date.
Suppose today is 24 December 2013,then Adddays(-1) will subtract Days from Current date as AddDays method as name supplies will add/subtract days based on the number supplied in parameter.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response