www.webdeveloper.com
Results 1 to 8 of 8

Thread: time help

  1. #1
    Join Date
    Jun 2003
    Location
    Indiana, USA
    Posts
    1,138

    time help

    How can I get rid of the 00 in 3:45:00 PM? I know there isnt a quick solution as I hear, but is there?!

  2. #2
    Join Date
    Mar 2003
    Posts
    575
    You don't seem very resourceful.

    Look for the second colon, and erase it and the next two characters.

  3. #3
    Join Date
    Mar 2003
    Posts
    575
    You don't seem very resourceful.

    Look for the second colon, and erase it and the next two characters.

  4. #4
    Join Date
    Jun 2003
    Location
    Indiana, USA
    Posts
    1,138
    Why did you have to post that twice? Also, how do I look for the second colon?

  5. #5
    Join Date
    Mar 2003
    Posts
    575
    Sorry. I was having browser problems.

    I don't know what language you're using, but isn't there a "search" feature for strings? If not, why not write your own?

    Or... if the language has built in date/time capabilities, write your own time-to-string function.

  6. #6
    Join Date
    Jun 2003
    Location
    Indiana, USA
    Posts
    1,138
    That is why I am posting in the ASP section of this forum, because I program in ASP.

  7. #7
    Join Date
    Aug 2004
    Posts
    94
    Are you using ASP scripts? If so, I can help.

    Dan

  8. #8
    Join Date
    Jun 2003
    Location
    Indiana, USA
    Posts
    1,138
    I figured out the coding and used:
    Code:
    <%
    Dim DT,Length,TheTime,AMPM
    DT = rs.fields("time_posted")
    Length = LEN(DT)
    TheTime = LEFT(DT, Length - 6)
    AMPM = RIGHT(DT, 2)
    DT = TheTime + " " + AMPM
    Response.Write DT
    %>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles