0
我這裏有一個工作代碼,但輸出是24小時格式:VB.net實時同步時鐘
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label1.Text = Now.TimeOfDay.ToString()
End Sub
我用了一個定時器,但我的輸出是這樣的:
17:00: 30.123456
我希望我的輸出是這樣的12小時格式:
下午5點00