TimeOfDay Property

   
TimeOfDay Property

Class

Microsoft.VisualBasic.DateAndTime

Syntax

 TimeOfDay 

Return Value

Date value giving the current system time

Description

Sets or returns the current system time

Example

The code:

 TimeOfDay(  ) = #9:05:13 AM# 

sets the system time, and the code:

 MsgBox(TimeOfDay(  )) 

displays the current system time.

Rules at a Glance

The TimeOfDay property returns the time in the time format defined by the system's regional settings.

Programming Tips and Gotchas

  • The TimeOfDay property includes an incorrect date, 01/01/0001, along with the time. It can be eliminated with the Format or FormatDateTime function as follows :

     Format(TimeOfDay(  ), "Long Time") FormatDateTime(TimeOfDay(  ), DateFormat.LongTime) 
  • When setting the TimeOfDay property, any date component is ignored.

See Also

Now Property

   


VB.Net Language in a Nutshell
VB.NET Language in a Nutshell
ISBN: B00006L54Q
EAN: N/A
Year: 2002
Pages: 503

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