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