TimeString Property


TimeString Property

Class

Microsoft.VisualBasic.DateAndTime

Syntax

     Dim result As String = DateAndTime.TimeString 

or:

     DateAndTime.TimeString = newTime 


newTime (required in second syntax; String)

A time in string format used to set the current system time

Description

The TimeString property gets or sets the current system time. The first syntax returns a string representing the current system time in the "HH:mm:ss" format, which uses a 24-hour clock. The second syntax sets the current system time using a string that is in any system-recognized time format.

Usage at a Glance

  • The first syntax always returns a time in the format "HH:mm:ss."

  • See the Format Function entry for details on custom time formats.

  • To get or set the current system date as a String, use the DateString property.

  • To access the current system time as a Date, use the TimeOfDay property.

  • The security settings of the active user may prevent the system date and time from being altered.

Version Differences

The TimeString property is new to VB under .NET.

See Also

TimeOfDay Property, TimeSerial Function, TimeValue Function




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net