We help IT Professionals succeed at work.

Seek function to trim seconds off vbLongTime

juststeve
juststeve asked
on
Medium Priority
656 Views
Last Modified: 2012-06-21
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)
Comment
Watch Question

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")
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

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

response.write Left(theTime,Len(theTime)-6) & (Right(theTime,2))
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.