Get yesteday's date - Visual Basic .NET

Tags: VB.NET, VB 2008, VB 2010, VB 2012, VB 2013

Let's say you like to adjust the datetimepicker value to yesterday:

DateTimePicker1.Value = DateTime.Today.AddDays(-1)

You can use the AddDays to go back to multiple days, or you can go forward by adding a positive number of days like:

DateTimePicker1.Value = DateTime.Today.AddDays(3)


Share This

Home | About | Contact | Privacy Policy

Copyright visual-basic-tutorials.com 2017 - All Rights Reserved.