|
主题: 小时数总多1?
|
 燕孤鸿
职务:普通成员
等级:1
金币:0.0
发贴:37
注册:2001/7/9 20:29:26
|
#12001/10/18 16:08:37
我做了一个读取系统时间的flash 可是不知为什么?它读取的小时数总比现有时间多个一个时。怎么会这样? (我的那个破空间不支持fla文件,所以放不上来,有没有高手告诉我你的e-mail,我发你的信箱里去,看看我到底哪里错了)
|
 闪客作家
职务:普通成员
等级:1
金币:10.0
发贴:275
注册:2001/3/1 5:54:52
|
#22001/10/18 17:51:11
得到的数组数为0-23, 没有问题, 你做的很对的。
|
 燕孤鸿
职务:普通成员
等级:1
金币:0.0
发贴:37
注册:2001/7/9 20:29:26
|
#32001/10/18 19:29:07
onClipEvent (load) { time = new Date(); } onClipEvent (enterFrame) { hours = time.getHours(); minutes = time.getMinutes(); seconds = time.getSeconds(); time = new Date(); } 虎哥那我应该怎么样把它改成小时数和系统时间一样呢?
|
 阿修罗飞天舞
职务:普通成员
等级:1
金币:0.0
发贴:115
注册:2001/5/23 9:14:30
|
#42001/10/18 23:15:10
AS和JS一样也有这个问题,你把你的小时数加上1不就可以了么
|
 燕孤鸿
职务:普通成员
等级:1
金币:0.0
发贴:37
注册:2001/7/9 20:29:26
|
#52001/10/19 8:10:37
阿修罗飞天舞在上个帖子中说 引用: AS和JS一样也有这个问题,你把你的小时数加上1不就可以了么
我就是因为不会加才问的,我对这个变量不是很熟
|
 困龙在天
职务:普通成员
等级:7
金币:10.0
发贴:2942
注册:2001/5/17 23:14:57
|
#62001/10/19 9:53:38
[url]http://sintian.chinaccd.net[/url]
|
 燕孤鸿
职务:普通成员
等级:1
金币:0.0
发贴:37
注册:2001/7/9 20:29:26
|
#72001/10/19 10:15:11
咦,如果改成hours=time.getHours()-1; 就不会出现了小时数多1的情况了吧
|
 困龙在天
职务:普通成员
等级:7
金币:10.0
发贴:2942
注册:2001/5/17 23:14:57
|
#82001/10/19 11:11:03
[url]http://sintian.chinaccd.net[/url]
|
 燕孤鸿
职务:普通成员
等级:1
金币:0.0
发贴:37
注册:2001/7/9 20:29:26
|
#92001/10/19 23:21:43
做好了一个,把代码给大家看看: onClipEvent (load) { time = new Date(); } onClipEvent (enterFrame) { hours = time.getHours()-1; minutes = time.getMinutes(); seconds = time.getSeconds(); time = new Date(); if (length(hours) == 1) { hours = "0"+hours; } if (length(minutes) == 1) { minutes = "0"+minutes; } if (length(seconds) == 1) { seconds = "0"+seconds; } if (hours == -1) { hours = 23; } }
|