Brian Boatright Brian Boatright - 1 year ago 76
Vb.net Question

Simplest method to determine if the current time is AM or PM?

What is the best method to determine if the current time is AM or PM using VB.NET?

Currently I'm using If Date.Today.ToString.Contains("AM") but I'm sure there is a better method.

Good <%If Date.Today.ToString.Contains("AM") Then Response.Write("Morning") Else Response.Write("Afternoon")%>

Answer Source

If Date.Now.Hour < 12 Then ... perhaps?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download