VB.Net program to demonstrate the MaxValue property of DateTime class

Here, we are going to demonstrate the MaxValue property of DateTime class in VB.Net.
Submitted by Nidhi, on January 21, 2021

The MaxValue property of DateTime is a read-only property, which is used to get the maximum value for an object of the DateTime class.


Date.MaxValue as Date

Program/Source Code:

The source code to demonstrate the MaxValue property of the DateTime class is given below. The given program is compiled and executed successfully.

'VB.NET program to demonstrate MaxValue property of 
'DateTime class.

Imports System

Module Module1
    Sub Main()
        Dim maxdate As DateTime

        maxdate = DateTime.MaxValue

        Console.WriteLine("Max date value: {0}", maxdate)
    End Sub
End Module


Max date value: 31-12-9999 23:59:59
Press any key to continue . . .


In the above program, we created a module Module1 that contains the Main() function. The Main() function is the entry point for the program.

In the Main() function, we created a reference of the DateTime class and then get the maximum supported value for an object of the DateTime class and print that value on the console screen.

VB.Net Date & Time Programs »


Comments and Discussions!


Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© some rights reserved.