var yesterday:Date; yesterday = new Date(); yesterday.setDate( yesterday.getDate() - 1 );
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Stuhr Sent: 27 March 2007 10:19 To: flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] How to find yesterday? [EMAIL PROTECTED] schrieb: > Is this simple? > > cur_day = new Date(); > //trace(cur_day.getDate()); > Var1=cur_day.getDate()-1;//27 > trace(var1);//26 the above doesn't take into account Day 1 of the current Month: function getYesterday () { var t:Date = new Date (); var daysBack:Number = 1; var today:Date = new Date (t.getFullYear (), t.getMonth (), t.getDate () - daysBack); return (today.getDate ()); } cheers micha _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com