as3 符串轉時間,as3 0 字串轉時間

2022-08-02 14:00:07 字數 563 閱讀 2331

1樓:匿名使用者

as3有乙個全域性函式,名字叫date()

有這麼乙個用法:若要將某個值轉換為 date 型別,請使用 x as date 代替 date(x)。

下面是次函式的介紹

date () 函式

public function date():string

語言版本 : actionscript 3.0

player 版本 : flash player 9

返回當前星期值、日期值、時間和時區的字串表示形式。 輸出的日期格式為:

day mon date hh:mm:ss tzd yyyy

例如:wed apr 12 15:30:17 gmt-0700 2006

若要將某個值轉換為 date 型別,請使用 x as date 代替 date(x)。

2樓:匿名使用者

function timestrtodate(timestr:string):date

//trace(timestrtodate("2009-1-2 11:33:33"));