1.显示系统时间
(1)添加Timer控件
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Label2.Text = DateTimePicker1.Value.ToString("yyyy年MM月dd日 ", System.Globalization.DateTimeFormatInfo.InvariantInfo)
Label1.Text = TimeString
End Sub
(2)直接显示
System.DateTime.Now
System.DateTime.Now.ToString("HH:mm")
按指定格式(“HH:mm”)
2. 计算时间
DateDiff("s", CDate(DataGridView1.Item(1, introw).Value), CDate(System.DateTime.Now.ToString("HH:mm")))
后者减前者