What about daylight savings!!!!!

I just created a tv listings app in flex and this approach did not work. Recently the clocks changed and 7pm became 8pm because of the daylight savings. I can't believe that there is not any other way to add a day without doing it through milliseconds.

Because I knew what time my shows started I could always use the setHours method. However I don't feel that this was or is the most scaleable solution.

Cheers

Michael


On 14 Apr 2008, at 00:50, Matthew Houliston wrote:

On 14/04/2008 01:34, Gabino Travassos wrote:

If I want 283 days in the future I add 1208129349 + (283 days *24 hours*60 minutes*60second) = 1232580549 and I convert that to whatever date format I want.

Gabino's right, and the Date class makes it easy :

var d:Date=new Date(2008,3,14);
d.time+=(86400000*283); // 283 days, in milliseconds
trace(d.getFullYear()+"/"+(d.getMonth()+1)+"/"+d.getDate());
// 2009/1/21
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to