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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extract Time out of DateTime Type

Status
Not open for further replies.

Yogeetarp

Programmer
Jun 7, 2006
10
US
I want to extract the Time (12-hour type, NOT military) from a DateTime type for the display. I was thinking about displaying it as string and formatting it. But am having some problems in this transaction.

Any help or suggestions will be greatly appreciated.
 
Thanks for looking at it. This worked:

MyStr = Format(MyDateTime, "hh:mm tt")
' Returns "05:04:23 PM".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top