Solved

Seek function to trim seconds off vbLongTime

Posted on 2004-03-23
3
539 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)
0
Comment
Question by:juststeve
  • 2
3 Comments
 
LVL 12

Expert Comment

by:kingsfan76
ID: 10662669
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")
0
 
LVL 12

Accepted Solution

by:
kingsfan76 earned 250 total points
ID: 10662741
actually the Left() function is more handy:

Left(formatDatetime(time(),vbLongTime),Len(formatDatetime(time(),vbLongTime))-6)

and if you want to keep the "AM/PM":

<%
theTime = formatDatetime(time(),vbLongTime)
response.write Left(theTime,Len(theTime)-6) & Right(theTime,2)
%>
0
 

Author Comment

by:juststeve
ID: 10666825
Excellent...i find the lower case am/pm looks best:

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

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question