How do you validate input time using preg_match method

Discussion in 'PHP' started by ketting00, Jul 31, 2011.

  1. #1
    Hi,
    I want to store time in a 12:25:30 format into the data base. But how can I validate the user input data using preg_match method. All search results I found come with time and date and the format like 10:50 AM, but I want time in 24 hour (00:00:00) format to use in further calculation. I know how to calculate such as 10:20:30 + 5:50:40 = 16:11:10.

    How do I achieve this.

    Thanks
     
    ketting00, Jul 31, 2011 IP
  2. ketting00

    ketting00 Well-Known Member

    Messages:
    782
    Likes Received:
    28
    Best Answers:
    3
    Trophy Points:
    128
    #2
    Never mind I got it.
     
    ketting00, Jul 31, 2011 IP