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!

time format problem

Status
Not open for further replies.

msay

Programmer
Aug 17, 2001
56
US
I'm trying to populate a textbox with the current time.
The format I want is ie. 5:30 PM.
The following code:
TextBox1.Text = Strings.Format(Now, "hh:mm AM/PM")

Produces this output: 5:30 A54/P54

Any Help would be appreciated!

Msay
 
you may want to look into the date.toShortTime and .toLongTime methods. Or if you are just formating a date, you can use now.tostring("hh:mm ") I can't remember what character represents the am/pm indicator, but pull up the documentation on data.tostring, I know it's in there.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top