comparing dates


i have form 2 buttons , check time elapsed between pushing of first second.  want make sure both pushed within 4 hours.  figure i'll need hidden field use date stamp first button.  don't know how figure out if 2 times within range.

 

thanks!

you can use global date variable. set when first button is

pushed, , calculate how time had passed when second 1 is

pushed.

you can read js's date object here:

http://w3schools.com/js/js_obj_date.asp

 

first button thus:

global.starttime = new date().gettime();

 

second button:

totaltimeinms = new date().gettime() - global.starttime;

totaltimeinhours = totaltimeinms / 3600000;



More discussions in JavaScript


adobe

Comments

Popular posts from this blog

Joomla site hacked, cant see front and - Joomla! Forum - community, help and support

Christian Home School Programs - Joomla! Forum - community, help and support

Trouble with PF_OutFlag_I_USE_AUDIO and PF_CHECKOUT_LAYER_AUDIO