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

N

Noozer

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!!!
 
T

Travis Newbury

Noozer said:
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)
 
N

Noozer

Travis Newbury said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top