开发者

how to convert the flex date object to MySQL date and time?

how to convert f开发者_运维知识库lex date objec to sql date and time,

i am using AMFPHP to connect with mysql

need help

cheers


actually the date to string of flex will give you the format like

Day Mon Date HH:MM:SS TZD YYYY

but sql is like

2010-12-14 00:00:00

so what you do is make a string of the sql format and just pass as object to AMFPHP that will save it to sql

and sql will accept it as date time

private function dateToString(date:Date):String
        {
            var dateString:String = date.fullYear+"-"+(date.month+1)+"-"+date.date+" "+date.hours+":"+date.minutes+":"+date.seconds;    
            return dateString;
        }//end function

cheers....


I suppose, the date is sent as string. In that case, use mysql function STR_TO_DATE()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜