宜昌本地软件开发与弱电工程服务商
项目咨询 · 快速响应
您当前的位置: > 博客2 > AS2与AS3技术

[AS3]AS3.0获取系统时间的代码写法

2016-10-13 00:16:48 点击量:8 标签: 收藏本文

[AS3]AS3.0获取系统时间的代码写法

  1. private function getTime():void 
  2.    {   
  3.     var timer:Timer=new Timer(1000); 
  4.     timer.addEventListener(TimerEvent.TIMER,showTimer); 
  5.     timer.start(); 
  6.    } 
  7.    private function showTimer(event:TimerEvent):void 
  8.    { 
  9.     var current:Date = new Date(); 
  10.     txt.text=current.fullYear.toString()+"-"+(current.month+1).toString()+"-"
    +current.date.toString()+" "+current.hours.toString ()+":"
    +current.minutes.toString()+":"+current.seconds.toString(); 
  11.    } 

 

ABOUT US
宜昌农人网络科技有限公司

我们是一家提供综合软件外包与弱电工程服务的技术公司。

业务涵盖定制软件、管理系统、网站、小程序、APP、系统集成、网络布线、监控安防、门禁、机房建设及长期技术维护。

公司地址:湖北省宜昌市伍家岗区东站二路6号三峡(宜昌)大数据产业园海洋馆二楼A203室