Display the Time Without the Seconds

The built in ASP time object returns the time in the format of HH:MM:SS AM/PM (i.e., 12:31:29 PM). Often times, you don't want to show the seconds, you just want to show HH:MM AM/PM. Now it can be done!

The Code:
DT = time()
Length = LEN(DT)
TheTime = LEFT(DT, Length - 6)
DT = TheTime + AMPM
Response.Write DT

The Result

12:31 PM

asp time 12 hour time no seconds

Back To Top
© 1998 - 2015 psacake.com | My3C's

Version 7.0a | Advertise on this site