Yes, but still it is depending of the localtime.

Trace(targetDate); gives me in the Netherlands: Tue Aug 26 12:00:00 GMT+0200
2008



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Kenneth
Kawamoto
Sent: dinsdag 26 augustus 2008 12:22
To: Flash Coders List
Subject: Re: [Flashcoders] is there a recognised date format for xml?

If so I'd ask my PHP coder to generate formatted string so that I need 
to code less ;)

e.g.
var xml:XML = <data date="Tue Aug 26 12:00:00 GMT 2008" />
var targetDate:Date = new Date([EMAIL PROTECTED]());

...a lot less code than yours!

Kenneth Kawamoto
http://www.materiaprima.co.uk/

Cor wrote:
> In PHP you can do whatever you want: see http://nl.php.net/date
> I think it can also depend on your server.
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of allandt
> bik-elliott (thefieldcomic.com)
> Sent: dinsdag 26 augustus 2008 11:48
> To: Flash Coders List
> Subject: [Flashcoders] is there a recognised date format for xml?
> 
> hi guys
> 
> i'm speccing an xml file for a server side dev that needs to return a
target
> date and time and i wanted to make sure i wasn't doing anything stupid
> 
> what would a php dev be expecting to use for time / date and how would
that
> be supplied in an xml file? And what would the best way of converting the
> return string for flash to use?
> 
> I was thinking something along the lines of
> <data date="2008,08,26" time="12,0,0" />
> 
> and using something like
> 
> var sDate:String = node.attributes.date;
> var sTime:String = node.attributes.time;
> 
> var arDate:Array = sDate.split(",");
> var nYear:Number = Number(arDate[0]);
> var nMonth:Number = Number(arDate[1]-1); // months start at 0
> var nDate:Number = Number(arDate[2]);
> 
> var arTime:Array = sTime.split(",");
> var nTimeHours:Number = Number(arTime[0]);
> var nTimeMinutes:Number = Number(arTime[1]);
> var nTimeSeconds:Number = Number(arTime[2]);
> 
> var targetDate:Date = new Date(nYear, nMonth, nDate, nTimeHours,
> nTimeMinutes, nTimeSeconds);
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to