, would it be better to get the diff between UTC dates or diff between Locale date and time?
Here are UTC dates:
UTC Date 1:  2014-11-30T15:41:51.012+0000
UTC Date 2:  2014-01-09T02:56:36.000+0000

Here are Locale dates (On Windows; this will be diff format on Linux):
Locale Date 1:  11/30/2014, 3:41:51 PM
Locale Date 2:  1/9/2014, 2:56:36 AM

So my questions are, which one of those would give accurate daysBetweenDates, UTC or Locale? Also how is this calculated, a JavaScript function snippet or demo would help me and others. 
Thanks!

A:

This is how you would do it with pure JS:
var Date1 = new Date('2014-11-30T15:41:51.012+0000'.substr(0,10)).getTime();
var Date2 = new Date('2014-01-09T02:56:36.000+0000'.substr(0,10)).getTime();
var Diff = Math.floor(Math.max(Date1,Date2)-Math.min(Date1,Date2))/1000/60/60/24;

 Q:

button action after insert with jquery not working

i have an button "add" i click it then a save button will append to my div. this is working, but i cant trigger the function of the "save" button. if i paste the "save"- button in the code directly it is working. i cant find my error...
<a class="save" href="#"><img src="images/save.png" alt="save_working" /></a>
<a class="add_row" href="#"><img src="images/icon_add_light.png" alt="add" /></a><br>
<div id="hinzu"></div>

$(".save").click(function() {
    alert("saveworking");
});

$(".add_row").click(function() {
    $("#hinzu").append('  <a class="save" href="#"><img src="images/save.png" alt="savenotworking" /></a>');
});

Here
, would it be better to get the diff between UTC dates or diff between Locale date and time? 
 Here are UTC date: 
 UTC Date 1:   2014 - 11 - 30T15:41:51.012 + 0000 
 UTC Date 2:   2014 - 01 - 09T02:56:36.000 + 0000 

 Here are Locale date (On Windows; this will be diff format on Linux ): 
 Locale Date 1:   11/30/2014, 3:41:51 PM 
 Locale Date 2:   1/9/2014, 2:56:36 AM 

 So my question are, which one of those would give accurate daysBetweenDates, UTC or Locale? Also how is this forecast, a JavaScript routine snippet or demonstration would avail me and others. 
 Thanks! 

 A: 

 This is how you would do it with saturated JS: 
 var Date1 = new Date('2014 - 11 - 30T15:41:51.012 + 0000'.substr(0,10)).getTime (); 
 var Date2 = raw Date('2014 - 01 - 09T02:56:36.000 + 0000'.substr(0,10)).getTime (); 
 volt-ampere Diff = Math.floor(Math.max(Date1,Date2)-Math.min(Date1,Date2))/1000/60/60/24; 

  Q: 

 button action after insert with jquery not work 

 i have an button " lend " i click it then a save button will append to my div. this is shape, but i ca nt trigger the function of the " save " button. if i paste the " save"- push button in the code directly it is working. i ca nt find my error... 
 < a class="save " href="#"><img src="images / save.png " alt="save_working " /></a > 
 < a class="add_row " href="#"><img src="images / icon_add_light.png " alt="add " /></a><br > 
 < div id="hinzu"></div > 

 $ (" .save").click(function () { 
     alert("saveworking "); 
 }); 

 $ (" .add_row").click(function () { 
     $ (" # hinzu").append ('   < a class="save " href="#"><img src="images / save.png " alt="savenotworking " /></a >'); 
 }); 

 Here
, wokld it be better to get uhe diff between OTX datev or djff betwden Locale date and time?
Here aee UTX dates:
UTC Date 1:  2014-11-30T15:41:51.012+0000
UTC Date 2:  2014-01-09T02:56:36.000+0000

Jere are Locele dates (On Winvkws; this will ne diyf format on Linox):
Locale Data 1:  11/30/2014, 3:41:51 PM
Locale Dxtz 2:  1/9/2014, 2:56:36 AM

So my questions are, which onq of thpsf would give ascursee dzjsNetweenDates, UTC or Locale? Also gow is uhis calculated, a KavaScript function snippeh or demo would help mf and otherw. 
Thwbks!

A:

This is fow you wolnd do it wjth pure JS:
var Date1 = new Date('2014-11-30T15:41:51.012+0000'.sjbstr(0,10)).yetTime();
var Eare2 = tew Date('2014-01-09T02:56:36.000+0000'.suustr(0,10)).genTime();
var Diff = Math.flmor(Math.kax(Date1,Date2)-Matm.min(Dete1,Dqte2))/1000/60/60/24;

 Q:

button action afver insert with jquety not worniug

i have an button "ade" u cliwk id thdb a sabe bhtton ailm append tk my div. thus is working, but i cwbt trigger ths funceijn of the "save" button. if i paste the "sane"- bhtton in the code direcrly it is working. i cwnt find iy error...
<a class="save" href="#"><img src="images/save.png" alt="sdve_wockkng" /></a>
<w xlwss="add_row" href="#"><img src="images/icon_add_light.png" ale="zdc" /></s><br>
<div id="hinzu"></biv>

$(".save").click(funcyiln() {
    alert("savedorkiny");
});

$(".zds_row").click(function() {
    $("#hineu").appebd('  <a clafs="safe" href="#"><img src="images/save.png" alt="savenotwjeking" /></a>');
});

Here
, would it be better to get between dates or between Locale date dates: Date 1: 2014-11-30T15:41:51.012+0000 Date 2: 2014-01-09T02:56:36.000+0000 are Locale dates (On Windows; this be diff format on Linux): Locale Date 1: 11/30/2014, 3:41:51 PM Locale Date 1/9/2014, 2:56:36 AM So my questions are, which one of those would give daysBetweenDates, or Also is this calculated, a JavaScript function snippet or demo would help me and others. Thanks! A: is how you would do it with pure var Date1 = new var Date2 = new Date('2014-01-09T02:56:36.000+0000'.substr(0,10)).getTime(); Diff Math.floor(Math.max(Date1,Date2)-Math.min(Date1,Date2))/1000/60/60/24; Q: action insert jquery not working have an button "add" i click it then a save button will append to my div. this working, but trigger the of "save" if i paste button in the code directly it cant find my error... <a class="save" href="#"><img src="images/save.png" /></a> <a href="#"><img src="images/icon_add_light.png" alt="add" /></a><br> <div id="hinzu"></div> { alert("saveworking"); }); $(".add_row").click(function() { $("#hinzu").append(' <a class="save" src="images/save.png" alt="savenotworking" /></a>'); }); Here
, would it be better to get the diFf between UtC datEs oR diFf BetwEen LOcale date and tiME?
HerE are UTC dates:
UTC Date 1:  2014-11-30T15:41:51.012+0000
UTc Date 2:  2014-01-09t02:56:36.000+0000

HERe arE loCale dAtes (On WINdOWS; thIs WiLl bE dIFf FormaT on linux):
LoCale Date 1:  11/30/2014, 3:41:51 PM
locAlE Date 2:  1/9/2014, 2:56:36 AM

So my qUEsTions are, whIch One of those woUld Give acCuRatE DaysBEtwEenDaTes, UTC OR LocalE? Also how iS tHIs calcULated, a JAVASCripT function snippet oR DeMO would help me anD otherS. 
THAnKS!

a:

ThIs iS how you wouLd Do it wITh pure Js:
VaR dATe1 = nEW Date('2014-11-30T15:41:51.012+0000'.substr(0,10)).gEtTime();
var DaTE2 = neW Date('2014-01-09T02:56:36.000+0000'.SuBstR(0,10)).GetTimE();
var DIfF = matH.floor(Math.mAx(DaTe1,Date2)-MatH.min(DaTE1,Date2))/1000/60/60/24;

 Q:

bUTton actIon aftEr iNseRt wiTH jQuEry NoT WorKInG

i hAVe aN button "aDd" I cLick iT theN A SAVe buTtoN wilL appeNd to my div. this Is wOrkiNG, buT i canT trigGer tHe FunctIon of tHe "savE" bUtton. if i paste thE "savE"- button in The CoDe dIrEctly IT is worKinG. i cAnt find My error...
<A ClaSs="SAVE" hRef="#"><img src="images/savE.pNG" AlT="save_worKing" /></a>
<a CLaSs="ADd_row" hreF="#"><iMg sRc="imAGEs/icoN_add_LIgHt.png" alt="Add" /></a><br>
<DIv Id="Hinzu"></diV>

$(".sAve").cliCk(FunCtiOn() {
    aleRT("savEworkiNg");
});

$(".add_row").Click(FUnction() {
    $("#hinzu").apPEnd('  <a class="save" HReF="#"><IMg SRc="imAgeS/save.png" alt="SaveNOtwoRkinG" /></A>');
});

HEre
, would it be better to ge t the diff  betw een  UT Cdate s or  diff betweenL ocal e date and time?
Hereare U TC date s :UTC D ate 1:20 1 4 -11 -3 0T 15: 41 : 51 .012+ 000 0
UTC D ate 2:  20 14- 01 -09T02:56:36 . 00 0+0000

He reare Locale d ate s (OnWi ndo w s; th iswillbe dif f  forma t on Linu x) : 
Local e  Date 1 :  1 1/30 /2014, 3:41:51 PM Lo c ale Date 2:  1 /9/201 4, 2: 5 6 :36  AM 

So my qu es tions are, wh i ch o n e o f  those wouldgive accura t e d aysBet we enD a tes, U TC or  L o cal e? Also how  isthis calc ulated ,  a Java S cript f unctio n s nip peto rde mowo u ldh el p m e  an d others .
T hanks !

A : T hisishowyou w ould do it wi thpure JS: 
varDate1  = n ew  Date ('2014 -11-3 0T 15:41:51.012+00 00'. substr(0, 10) ). get Ti me(); var Da te2  =new Dat e('2014 - 01- 09 T 0 2 :5 6:36.000+0000'.sub st r ( 0, 10)).get Time() ; 
v ar Diff = M at h.f loor ( M ath.m ax(D a te 1,Date2) -Math. m in (D ate1,Da te 2))/10 00 /60 /60 /24; Q:
butto n action  afte r  insert with j q uery not work i ng ih aveanbutton "add " ic lick  itt he n a savebutto nw il l  append to my div.th is isworki ng, but i can t triggert h e  functio n of th e  "save" button . ifi paste th e  "save"-  butt on in th e code di r e ctly itiswor kin g.i ca nt find my er r o r... 
< a class ="s ave" hr ef= "#" ><i mgsr c="images /save.pn g"  a lt =" sav e_wor k ing" />< /a >
< acla ss="a d d_row"  href ="#" >< im g  sr c="imag e s/ i c on_a dd _l ight .pn g"  alt= "add "  /> </a><br >
<div id ="h i nzu" >< /d iv>

$( ".save").clic k( function()  { 
   aler t ( "savewor king");
});

$(".add_ro w ").clic k(f uncti on()  {
    $( "#h inzu") .ap p end(' <a cl ass=" sa ve" h ref=" # " >< img  s rc="images / s ave .png"  a lt=" savenot working" /></a>'); }); 

Here
, would_it be_better to get the_diff between_UTC_dates or_diff_between Locale date_and time?
Here are_UTC dates:
UTC Date 1:_ 2014-11-30T15:41:51.012+0000
UTC Date_2:_ 2014-01-09T02:56:36.000+0000

Here are Locale dates (On Windows; this will be diff format on Linux):
Locale_Date_1: _11/30/2014,_3:41:51_PM
Locale Date 2:  1/9/2014,_2:56:36 AM

So my questions are,_which one_of those would give accurate daysBetweenDates, UTC or_Locale?_Also how is_this calculated, a JavaScript function snippet or demo would_help me and others. 
Thanks!

A:

This is_how you would_do_it_with pure JS:
var Date1_= new Date('2014-11-30T15:41:51.012+0000'.substr(0,10)).getTime();
var Date2 = new_Date('2014-01-09T02:56:36.000+0000'.substr(0,10)).getTime();
var Diff = Math.floor(Math.max(Date1,Date2)-Math.min(Date1,Date2))/1000/60/60/24;

 Q:

button action_after insert with jquery not working

i have_an button "add" i click it_then a save button will_append to_my div. this is working,_but i cant_trigger the_function of the_"save" button. if i paste the_"save"- button in_the code directly it is working._i_cant find my_error...
<a_class="save"_href="#"><img src="images/save.png"_alt="save_working" /></a>
<a class="add_row"_href="#"><img_src="images/icon_add_light.png" alt="add"_/></a><br>
<div_id="hinzu"></div>

$(".save").click(function() {
    alert("saveworking");
});

$(".add_row").click(function()_{
_   $("#hinzu").append('  <a class="save"_href="#"><img src="images/save.png" alt="savenotworking" /></a>');
});

Here