因為系統自動帶出的時間是有上午下午的

2006-07-04 上午 11:1:57

還用,format 方法,也一樣是這樣的格式


,所以做最苯的方法:

 If Hour(Date.Now) >= Hour(#1:00:00 PM#) Then

            Dim sdate As String = (CInt(Date.Now.Hour.ToString) + 12).ToString

            sdate = sdate + ":" + Date.Now.Minute.ToString + ":" + Date.Now.Second.ToString

            Me.Label1.Text = Date.Now.ToShortDateString + " " + sdate

        Else

            Me.Label1.Text = Date.Now.ToShortDateString + " " + Date.Now.Hour.ToString + ":" + Date.Now.Minute.ToString + ":" + Date.Now.Second.ToString

        End If

這樣顯示出來就是

2006-07-04 11:1:57