Javascript help - User input time -> date/time value for MS Access database

Discussion in 'HTML' started by Noozer, Aug 1, 2005.

  1. Noozer

    Noozer Guest

    I have a textbox on one of my forms that is used to accept a time from the
    user. I need to write this value to a database to trigger an event later on.

    What I'd like to know is...

    Are there any functions in javascript that can convert different time
    formats to a known format (24 hour clock)... 5pm -> 17:00 or 5:00 -> 05:00,
    etc. ???

    Assuming that I get the input into a 24 hour format, how can I create a full
    time/date variable with todays date and the users entered time?

    Finally, if the entered time is earlier than the current time, how can I
    create the above date/time combination using tomorrows date?

    Thanks!!!
     
    Noozer, Aug 1, 2005
    #1
    1. Advertising

  2. Noozer wrote:
    > I have a textbox on one of my forms that is used to accept a time from the
    > user. I need to write this value to a database to trigger an event later on.
    > What I'd like to know is...
    >
    > Are there any functions in javascript that can convert different time
    > formats to a known format (24 hour clock)... 5pm -> 17:00 or 5:00 -> 05:00,
    > etc. ???


    Wouldn't this be better done on the server?

    Google "javascript date object" With it you can create a data object
    based on the strng the visitor enters. once it is a "date" then yo can
    do what ever you like with it (based on the propertied an methods of
    the date object)

    --
    -=tn=-
     
    Travis Newbury, Aug 1, 2005
    #2
    1. Advertising

  3. Noozer

    Noozer Guest

    "Travis Newbury" <> wrote in message
    news:...
    > Noozer wrote:
    > > I have a textbox on one of my forms that is used to accept a time from

    the
    > > user. I need to write this value to a database to trigger an event later

    on.
    > > What I'd like to know is...
    > >
    > > Are there any functions in javascript that can convert different time
    > > formats to a known format (24 hour clock)... 5pm -> 17:00 or 5:00 ->

    05:00,
    > > etc. ???

    >
    > Wouldn't this be better done on the server?
    >
    > Google "javascript date object" With it you can create a data object
    > based on the strng the visitor enters. once it is a "date" then yo can
    > do what ever you like with it (based on the propertied an methods of
    > the date object)


    Thx... I decided to avoid the headache and imposed a selection (using
    <SELECT>) instead. Much easier than trying to guess what the users trying to
    enter.
     
    Noozer, Aug 1, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,308
    Michael Borgwardt
    May 30, 2004
  2. moonhk
    Replies:
    5
    Views:
    555
    moonhk
    Oct 11, 2006
  3. Renie83
    Replies:
    2
    Views:
    237
  4. magix
    Replies:
    1
    Views:
    377
    magix
    Feb 12, 2006
  5. Susan Cranford
    Replies:
    2
    Views:
    414
Loading...

Share This Page