开发者

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

开发者 https://www.devze.com 2023-01-30 12:34 出处:网络
how to convert f开发者_运维知识库lex date objec to sql date and time, i am using AMFPHP to connect with mysql

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

精彩评论

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