纽约时区的北京奥运会VB倒计时代码怎么写?

来源:百度知道 编辑:UC知道 时间:2024/05/11 12:14:26

放一个timer就行了:

Const Adate = #8/8/2008 8:40:00 AM# '常量纽约时间的北京奥运会开幕时间

Private Sub Form_Load()
Timer1.Interval = 1000
Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
Cls
Print "纽约时间的北京奥运会开幕时间为"; Adate
Print "目前为止还有"; DateDiff("d", Date, #8/8/2008#); "天 ";
Print Format(DateAdd("s", DateDiff("s", Time, #8:40:00 PM#), 0), "h小时m分钟s秒")
End Sub