I have two dates in format: Y-m-d H:i:s
How I can calculate time beetweeb two dates:
data.endTime - data.startTime
I have two dates in format: Y-m-d H:i:s
How I can calculate time beetweeb two dates:
data.endTime - data.startTime
The best way is like @Paul S. say, convert them into Date, and then yo can make something like this:
var resultInMs = date_end.getTime() - date_start.getTime();
Hope it works for you.
PD: Here is something that can help you http://www.w3schools.com/jsref/jsref_obj_date.asp
PD2: Like @James Thorpe says Mozilla Docs is also a very good source of information (Even better): https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date