flex显示数字时钟和日期
来源:互联网 发布:深圳大数据协会 编辑:程序博客网 时间:2024/04/30 02:44
private function init():void{
var timer:Timer = new Timer(1000);
timer.addEventListener(TimerEvent.TIMER, this.resetTime);
timer.start();
}
private function resetTime(event:TimerEvent):void{
var today:Date = new Date();
var dateFormatter:DateFormatter = new DateFormatter();
var timeFormatter:DateFormatter = new DateFormatter();
dateFormatter.formatString = "YYYY年MM月DD日";
timeFormatter.formatString = "HH:NN:SS";
var time:String = timeFormatter.format(today);
var date:String = dateFormatter.format(today);
var week:Number = today.day;
var weekStr:String = "星期";
switch(week){
case 0: weekStr += "日";
break;
case 1: weekStr += "一";
break;
case 2: weekStr += "二";
break;
case 3: weekStr += "三";
break;
case 4: weekStr += "四";
break;
case 5: weekStr += "五";
break;
case 6: weekStr += "六";
break;
}
this.lb_date.text = date + " " + weekStr;
this.lb_time.text = time;
}
<mx:Label text="" width="150" height="21" right="111" top="9" id="lb_date"/>
<mx:Label text="" width="80" height="21" right="28" top="9" id="lb_time"/>
- flex显示数字时钟和日期
- 用flex如何显示数字时钟
- 《显示数字时钟》
- 在LCD1602上面显示DS1302掉电时钟和日期
- Flex格式化显示日期
- flex日期,数字和货币的简单格式化操作
- 手机数字时钟动态显示
- gridview列 数字、货币和日期 显示格式
- gridview列 数字、货币和日期 显示格式
- gridview列 数字、货币和日期 显示格式
- GridView绑定列数字、货币和日期的显示格式
- gridview列 数字、货币和日期 显示格式
- gridview列 数字、货币和日期 显示格式
- gridview列 数字、货币和日期 显示格式
- GridView列数字、货币和日期的显示格式
- gridview列 数字、货币和日期 显示格式
- GridView列数字、货币和日期的显示格式
- C#, GridView列数字、货币和日期的显示格式
- 被触动心灵的感觉.....
- 写自己的ls命令
- Thinking in Java笔记7
- Squirrel中的类与实例
- 3D模型的姿态单位化
- flex显示数字时钟和日期
- oracle set serveroutput on
- 在iPhone程序上读取PDF文件
- POJ 1845 Sumdiv
- 新站长如何选择合适的CMS
- POJ题目分类
- 用Crosstool-0.43制作交叉交叉工具链的一些心得!(上)
- 详解C语言开发unix/Linux下安全套接字(SSL)的TCP服务端程序
- 音量的计算