Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Seek function to trim seconds off vbLongTime

Posted on 2004-03-23
3
Medium Priority
?
577 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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 informatio…
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…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

604 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