Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27531

VS 2012 Formatting strings - DateTime - Show AM/PM - Easy Question!

$
0
0
Hi Guys,

Having an issue, basically I am using the code below on a Timer to display a live clock

Code:

Dim time As DateTime = DateTime.Now
Dim format As String = "dddd d MMMM yyyy hh:mm:ss"
lblClock.Text = time.ToString(format)

But I'd also like to display AM or PM on that, but I can't work out how. I've tried adding AM:PM and variations of this, I know this is probably obvious but if anyone could tell me that'd be brilliant!

Thanks,

Ryan

Viewing all articles
Browse latest Browse all 27531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>