Does anyone have experience in using jquery.countdown in asp.net?
In my code behind, I set a date like this
public string datostreng;
protected void Page_Load(object sender, EventArgs e)
{
string format = "ddd MMM d yyyy HH:mm:ss";
DateTime _tempdato = DateTime.Now.AddDays(1);
datostreng = _tempdato.ToString(format);
}
On the .aspx page, I have
<script type="text/javascript">
$(function () {
var dato = new Date();
dato = '<%=datostreng %>';
$('#defaultCountdown').countdown({ until: dato, format: 'HMS' });
//alert(dato);
});
The counter shows up allright, but it starts counting down from 34 minutes and 56 seconds, weird.. In my example, it should count down from 24 hours.
In the original jquery.countdown sample, they have a dateformat like this: Thu Jan 26 2012 00:00:00 GMT+0100
In my example, it looks like this: fr jan 28 2011 09:50:43
So, I guess the question is, how do I produce a date in C# that satisfies that jquery.countdown function?