TimeOfDay Property


TimeOfDay Property

Class

Microsoft.VisualBasic.DateAndTime

Syntax

     Dim result As Date = DateAndTime.TimeOfDay 

or:

     DateAndTime.TimeOfDate = newTime 


newTime (required in second syntax; Date)

A time used to set the current system time

Description

The TimeOfDay property gets or sets the current system time of day. The first syntax returns a Date representing the current system time, with the date set to January 1, 1 AD. The second syntax sets the current system time using a Date; any date component of that value is ignored.

Usage at a Glance

  • The TimeOfDay property includes the date January 1, 1 AD, along with the current system time. Use one of the date formatting features to exclude this date when presenting the date for display:

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

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

See Also

Now Property




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