Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how to remove seconds in time and retain the AM or PM

Posted on 2003-11-10
4
Medium Priority
?
1,454 Views
Last Modified: 2008-02-01
how to remove seconds in time and retain the AM or PM

sample:

8:05:30 AM  or  7:45:00 PM

i want to show only the hours, minutes and AM or PM.

8:05 AM  or  7:45 PM

thanks
0
Comment
Question by:ziaguintu5
[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
4 Comments
 
LVL 5

Accepted Solution

by:
ho_alan earned 92 total points
ID: 9720255
newTime = FormatDateTime(Date(),4)
result = newTime
newHour = Hour(newTime)
if newHour > 11 then
       result = newHour & ":" minute(newTime) & "PM"
else
       result = newHour & ":" minute(newTime) &"AM"
end if
0
 
LVL 2

Assisted Solution

by:Sairam_S
Sairam_S earned 88 total points
ID: 9720287
<%
  sTime = "8:05:30 AM"
 
  sTimeArr = Split(sTime, " ")
  sTimeAlone = Split(sTimeArr(0), ":")

  sTime = sTimeAlone(0) & ":" & sTimeAlone(1) & " " & StimeArr(1)
  Response.Write sTime
%>
0
 
LVL 7

Expert Comment

by:vnvk
ID: 12046636
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
    Split: ho_alan {http:#9720255} & Sairam_S {http:#9720287}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

vnvk
EE Cleanup Volunteer
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
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…

704 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