以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]一字符,怎样判断它是日期还是时间  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=107875)

--  作者:小美菜
--  发布时间:2017/10/11 19:59:00
--  [求助]一字符,怎样判断它是日期还是时间
一字符串,怎样判断它是日期字符还是时间字符
--  作者:有点甜
--  发布时间:2017/10/11 20:52:00
--  

要判断的字符怎么样的?举例说明。

 

dim str as string = "2017-10-11 20:50:52"
Dim d As Date
If Date.TryParse(str, d) Then
    msgbox(d)
Else
    msgbox("不是日期时间")
End If