我有字符串值17:00:25如何顯示帶HHmm格式的字符串
如何顯示只有1700的軍事時間? IM中包含
Dim time As String = String.Format("{0:hh:mm}", row("timereported"))
MessageBox.Show(time.ToString)
和實際的代碼是
For Each row As DataRow In table.Rows
rowInsert = DS.Tables(0).NewRow
Dim time As String = String.Format("{0:hh:mm}", row("timereported"))
rowInsert(0) = time
DS.Tables(0).Rows.Add(rowInsert)
Next row
調試,但它顯示爲17時00分25秒
任何其他種轉換或格式的適合於格式化?
17:00:25是mySQL時間數據類型sir –
我已經更改了將字段視爲TimeSpan的代碼,請讓我知道它是否有效。 – SSS
如果字段是文本字段,我還添加了代碼 – SSS