Visual Basic Get Now

The DateTime.Now property is used to get the current time in Visual Basic. We can display time in various formats.

Let's examine the examples below..

Module ModuleTest Sub Main() Dim now As DateTime = DateTime.Now Dim now2 As String = DateTime.Now.ToString("h:mm:ss") Console.WriteLine(now) Console.WriteLine(now2) Console.ReadLine() End Sub End Module


You May Interest

How to Find the Name of the Operating System in Visual Basic ?

Visual Basic Remove Element from Array

Visual Basic Finding the Computer Name

Visual Basic Non-Restart Check If Application is Open

Visual Basic String Using StartsWith