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

Visual Basic How To Find The Average Of 10 Numbers Using A While ...

Visual Basic Remove Element from Array

Visual Basic String Using StartsWith

Visual Basic Finding the Operating System Username

Visual Basic Randomly Shuffle a List