VB.net Program to Print Yesterday’s Date

You are currently viewing 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 . . .

Ranjith Kumar

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

Leave a Reply