Link to home
Start Free TrialLog in
Avatar of juststeve
juststeve

asked on

Seek function to trim seconds off vbLongTime

Someone has probably written or found a function that would strip the :00 from the end of the string returned by code like:

FormatDateTime(wDate,vbLongTime)
Avatar of kingsfan76
kingsfan76

would this work:

Response.Write Mid(formatDatetime(time(),vbLongTime),1,Len(formatDatetime(time(),vbLongTime))-6)

just use the Mid() function.  the logic behind is that there is always 6 characters you want strip from the right (i.e.  "1:45:00 PM"  -->  ":00 PM")
ASKER CERTIFIED SOLUTION
Avatar of kingsfan76
kingsfan76

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of juststeve

ASKER

Excellent...i find the lower case am/pm looks best:

response.write Left(theTime,Len(theTime)-6) & (Right(theTime,2))