ActionScript 3 iso 8601到as3 date对象

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ActionScript 3 iso 8601到as3 date对象相关的知识,希望对你有一定的参考价值。

//trace(new Date("2010/05/03T14:14Z")); ----> this will error 'invalid date'

var isoDate = "2010-05-03T14:14Z";

//this will remove the T and Z
var date = isoDate.replace(/[A-Z]/gi," ");

//this will replace the hypens with forward slashes
date = date.replace(/\-/gi, "/");

//this casts the string to date and creates the correct date object
trace(new Date(date));

以上是关于ActionScript 3 iso 8601到as3 date对象的主要内容,如果未能解决你的问题,请参考以下文章