Name

TimeString Property — Microsoft.VisualBasic.DateAndTime

Synopsis

TimeString(  )

Return Value

String representing the current system time

Description

The TimeString property returns the current system time in the format determined by the system’s regional settings. You can use any time format recognized by IsDate when setting the time using the TimeString property.

The string returned by the TimeString property also includes an invalid date, 01/01/0001. It can be eliminated with the Format or FormatDateTime function as follows:

Format(TimeOfDay(  ), "Long Time")
FormatDateTime(TimeOfDay(  ), DateFormat.LongTime)

Get VB.NET Language Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.