javascript - Convert system date into est time zone and compare two dates -


in application getting json have date string. have requirement comparing date current date , time in est timezone format. input date tue jun 23 2015 11:57:00 , current date should in same format in est time zone

i have compare both of those.

you can server time , compare yours

function converttoservertimezone(){    //est     var offset = -5.0     var clientdate = new date();     var yourinputdate = new date("tue jun 23 2015 11:57:00");     var utc = clientdate.gettime() + (clientdate.gettimezoneoffset() * 60000);     var serverdate = new date(utc + (3600000*offset));     var dateformated = serverdate.toisostring().substr(0,10);     var dateformatedyourdate = yourinputdate.toisostring().substr(0,10);     if(dateformated > dateformatedyourdate){        //here compare string values     } } 

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -