after resolving my problem about converting a string into a date in titanium , i managed to get that date in milliseconds and the current time too as shown in this code :
Ti.API.error("+*///+++ FormatDate(NightsArray[i][3]).getTime() : "+parseInt(FormatDate(NightsArray[i][3]).getTime()));
var date1 = parseInt(FormatDate(NightsArray[i][3]).getTime());
Ti.API.error("+*///+++ d.getTime() : "+parseInt(d.getTime()));
var date2 = parseInt(d.getTime());
Ti.API.error("+*///+++ comparaison : "+date2 < date1);
Ti.API.error("+*///+++ comparaison : "+date2 > date1);
if(date2 > date1)
Ti.API.error("+*///+++ Diff : "+date2 - date1);
else
Ti.API.error("+*///+++ Diff : "+date1 - date2);
i parsed these both dates formatted in milliseconds into integers hopping finally to get rid of dates problems by only working with numbers but as shown in the console : all comparaisons return 0 and the difference NaN
[ERROR] : +*///+++FormatDate(date) : Thu Feb 20 2014 23:00:00 GMT+0100 (CET)
[ERROR] : +*///+++ FormatDate(NightsArray[i][3]).getTime() : 1392933600000
[ERROR] : +*///+++ d.getTime() : 1392634864589
[ERROR] : 0
[ERROR] : 0
[ERROR] : NaN
What's wrong !