Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dtpicker .value (as time only)

Status
Not open for further replies.

amclean

Technical User
Feb 20, 2002
1
CA
Is there a way to have a dtpicker return only the time as its value?

Thanks in advance...
 
Hi,

If you want the dtp to display only time, set the format property to time.

If you want the time selected to appear somewhere else such as a textbox you can use the Format statement e.g.

Text1.Text = Format(DTPicker1.Value, "long time")

Jon
 
If all you want is the current time why not use the Time function. It works just like the Date function.

' Returns current system time in the system-defined long time format.
MyStr = Format(Time, "Long Time")

' Returns current system date in the system-defined long date format.
MyStr = Format(Date, "Long Date")
Thanks and Good Luck!

zemp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top