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

Format Time Question

Status
Not open for further replies.

mdr2273

Programmer
Joined
Sep 4, 2006
Messages
22
Location
US
How would I format an Access time field to display as 8:00 PM?
 
Code:
<%
response.write formatdatetime(now(),3)
%>

-DNG
 
This makes the result show up as 8:00:00 PM. Is it possible to get rid of the seconds?
 
try this:

Code:
<%
dim mydate
mydate= split(formatdatetime(now(),3)," ")
response.write Mid(mydate(0),1,instrrev(mydate(0),":")-1) &" "& mydate(1)

%>

-DNG
 
Works like a charm, thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top