VB.Net program to print yesterday’s date

Sometimes we get frustrated if we do not get the information we need in some articles. But this article has all the information you need when you read VB.Net program to print yesterday’s date. Read patiently and understand.

VB.Net program to print yesterday's date

VB.Net program to print yesterday’s date

'VB.NET program to print yesterday's date.

Imports System

Module Module1
    Sub Main()

        Dim today As DateTime = DateTime.Now
        Dim yesterday As DateTime

        yesterday = today - New TimeSpan(1, 0, 0, 0)

        Console.WriteLine("Yesterday: {0}/{1}/{2}", yesterday.Day, yesterday.Month, yesterday.Year)
    End Sub
End Module
Yesterday: 17/1/2021
Press any key to continue . . .

Final Words

We hope the VB.Net program to print yesterday’s date article helped you in some way. And let us know if you have any doubts. Thanks

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Deekshi. Here, I post about programming to help developers.

Share on:

Leave a Comment