Thanks I've already fixed it This is the string I get from php
tijdAlles=2006:11:02:08:39:40& This is the function function checkTime(){ trace(this); var s_date = this.tijdAlles; function dateStringToObject(dateString){ var date_ar = dateString.split(":"); trace(date_ar[0]); return new Date(date_ar[0], date_ar[1]-1, date_ar[2], date_ar[3], date_ar[4], date_ar[5]); } var myDateObj = dateStringToObject(s_date); trace("myDateObj = "+myDateObj); -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steven Sacks | BLITZ Sent: woensdag 1 november 2006 20:04 To: Flashcoders mailing list Subject: RE: [Flashcoders] How can I get a string in a date object ? The compiler only catches strict typing issues at compile-time, not run-time. It doesn't know what this.jaar is (because it's being loaded in at run-time) so it doesn't catch that you're loading a string into it. Since AS2 isn't actually strict (just for the compiler's sake), you can put strings into variables you type cast as Number. You need to type cast the strings as numbers when they load in. var jarr:Number = Number(this.jaar); etc. HTH, Steven _______________________________________________ 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