✔ 最佳答案
要看你乜Project,係EXE Project,畫一個Timer,為佢寫一堆Code! 如果係VBA Project應該用不到Timer (不是每一種Project都都), set timer為 (1000 as interval and enabled as false),用Now()作為現時時間, 可再加上Hour(),Mintues(), Second()
Private Sub Form_Load()
Timer1.Interval = 1000
End Sub
(1)----------------- -------------------- ----
Private Sub Timer1_Timer()
Label1.Caption = Now
End Sub
(2)----------------- -------------------- ----
Text1 = Format(Time, "hh:mm:ss AMPM")
Function RetDateTime() As String
Appdate = Date
Apptime = Time
nl = Chr$(10) + Chr$(13)
RetDateTime = "Current Time : " & Apptime & nl & "Todays Date : " & Appdate
End Function
Private Sub Timer1_Timer()
Label1.Caption = Format(Time, "hh:mm.ss&a mp;a mp;quot;)
End Sub
參考資料:
http://www.vbforums. com/showthread.php?t =70991