可以用Now(),不過只是獲取當前時間,
如果要與系統時間同步,還需要用個定時器Timer()來執行獲取系統時間:
Print Date; "日期"
Print Time; "時間"
Print Now; "日期和日間"
Print Format(Now, "yyyy年mm月dd日 hh時mm分ss秒")
Print Year(Now); "年"
Print Month(Now); "月"
Print Day(Now); "日"
Print Hour(Now); "時"
Print Minute(Now); "分"
Print Second(Now); "秒"
private sub form_load()
text1.text=year(now)
text2.text=month(now)
text3.text=day(now)
text4.text=hour(now)
text5.text=minute(now)
text6.text=second(now)
end sub.
可以用Now(),不過只是獲取當前時間,
如果要與系統時間同步,還需要用個定時器Timer()來執行獲取系統時間:
Print Date; "日期"
Print Time; "時間"
Print Now; "日期和日間"
Print Format(Now, "yyyy年mm月dd日 hh時mm分ss秒")
Print Year(Now); "年"
Print Month(Now); "月"
Print Day(Now); "日"
Print Hour(Now); "時"
Print Minute(Now); "分"
Print Second(Now); "秒"
private sub form_load()
text1.text=year(now)
text2.text=month(now)
text3.text=day(now)
text4.text=hour(now)
text5.text=minute(now)
text6.text=second(now)
end sub.