疫情期间手机直线:18622734798
当前位置:首页网站设计:进阶篇 → 全部信息
日期时间格式化timeFormat知识
更新时间:2012/10/25 点击:1505次
原Date格式:FriDec1109:00:01GMT+08002009 格式化后的日期格式为:2009/12/11周五 09:00 ============= staticpublicconst DAYS:Array =[周日,周一,周二,周三,周四,周五,周六]; staticpublicfunctiongetDateString(date:Date):String { var dYear:String =S原Date格式:Fri Dec 11 09:00:01 GMT+0800 2009  格式化后的日期格式为:2009/12/11 周五 09:00  =============  static public const DAYS:Array = ["周日","周一","周二","周三","周四","周五","周六"];     static public function getDateString(date:Date):String {      var dYear:String = String(date.getFullYear());           var dMouth:String = String((date.getMonth() + 1 < 10) ? "0" : "") + (date.getMonth() + 1);           var dDate:String = String(date.getDate() < 10) ? "0" : "") + date.getDate();           var ret:String = "";           ret += dYear + "/" + dMouth + "/" + dDate + " ";           ret += DAYS[date.getDay()] + "";           ret += ((date.getHours() < 10) ? "0" : "") + date.getHours();           ret += ((date.getMinutes() < 10) ? "0" : "") + date.getMinutes();       // 想要获取秒的话,date.getSeconds() ,语句同小时、分           return ret; }
  • 疫情期间手机直线:18622734798    服务邮箱:service@nfree.cn     QQ:1448132697
  • 地址:天津市河西区围堤道146号华盛广场B座22楼    

    津公网安备 12010302001042号

  • CopyRight 2006~2025 All Rights Reserved 天津市华易动力信息科技有限公司