jquery - How to get hours from date picker and calculate -


how can calculate time between 2 date pickers, i'm using date time picker (dynarch)

the date times so..

txt2 = 01/07/2011 5:40:00 pm

assuming date part in format mm/dd/yyyy, , have dates stored in txt1 , txt2 vars, should do:

var differenceinseconds = (date.parse(txt2) - date.parse(txt1))/1000; 

edit need in dd/mm/yyyy format, can use calendar.parsedate() function calendar api. code be:

var differenceinseconds = (calendar.parsedate(txt2, false).gettime() - calendar.parsedate(txt1, false).gettime())/1000; 

hope helps. cheers


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -