countdown - Jquery Count down Serversync issue -


hi trying use countdown serversync, there couple of questions related none of them giving clear solution

my timer callback server c# code below

 public jsonresult getcurrentdatetime()     {                  var date = datetime.utcnow;        return json(data: date);      }  output is: thu may 23 2013 10:23:00 gmt+0100(gmt daylight time) 

and countdown calling script code below:

<script type="text/javascript">         function servertime() {             var stime;             $.ajax({                 type: "post",                 url: "/auction/getcurrentdatetime",                 contenttype: "application/json; charset=utf-8",                 datatype: "json",                 data: "{}",                 async: false,                 success: function (msg) {                     stime = new date(parseint(msg.replace(/(^.*\()|([+-].*$)/g, '')));                  },                 error: function (msg) {                 }             });              return stime;         }  //easter standard time or eastern daylgiht time var daylightoffset = esttime.dst() ? -4 : -5;  $('#defaultcountdown').countdown({ until: esttime,  timezone: daylightoffset, serversync: servertime, onexpiry: showasclosed }); 

when deploy code server , access in local machine, , change local machine datetime, counter down change count down time...! expected countdown timer depend on server not local machine.

what mistake doing here! have no clue. idea appreciated.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -