VB6.0 将字符串转成时间 比如现在是2010年8月10日18点10分15秒 我定义了一个字符串: 20100810181015 怎么样转成标准的时间格式:2010-08-10 18:10:15 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Private Sub Command1_Click() Dim strTime As String strTime = "20100808165530" Text1.Text = Mid(strTime, 1, 4) & "-" & _ Mid(strTime, 5, 2) & "-" & _ Mid(strTime, 7, 2) & " " & _ Mid(strTime, 9, 2) & ":" & _ Mid(strTime, 11, 2) & ":" & _ Mid(strTime, 13, 2)End Sub Private Sub Command1_Click() Dim strDate As Date Dim strSj As String strSj = "20100810181015" strSj = Mid(strSj, 1, 4) & "-" & Mid(strSj, 5, 2) & "-" & Mid(strSj, 7, 2) & " " & Mid(strSj, 9, 2) & ":" & Mid(strSj, 11, 2) & ":" & Mid(strSj, 13, 2) strDate = CDate(strSj) Text1 = strDateEnd Sub Private Sub Command1_Click() Dim t As String t = Format("20100810181015", "0000-00-00 00:00:00") MsgBox tEnd Sub 用三楼的方法就可以转成了,如果要转成日期格式加个CDATE()就可以了CDATE(Format("20100810181015", "0000-00-00 00:00:00")) 学猴哥的,我也用过format()好方便的。 Private Sub Command1_Click() Dim t As String t = Format("20100810181015", "yyyy-MM-dd hh:mm:ss") MsgBox tEnd Sub VB 界面美化 //////我能将gif图片放到剪贴板中再读出吗? 怎么用vb做像 Front Page中的“导航”中的 那种树状结构??? 怎样把ACCESS库里的相片读到image图片框里显示出来? 请问sp5要装在vb6.0的哪个目录下 VB 中读取Word文档出现的错误,麻烦各位大神帮忙解决一下 如何在image控件中加载.pcx图形文件或用什么控件来显示 MSFlexGrid 控件的最高版本是什么?在那可免费下栽 知道的快救我 绘图的基本问题 CommonDialog 控件(“打印”对话框)怎么用? 紧急求助高手们一个VB问题,不吝赐教 VB COM 的调试 十万火急
Private Sub Command1_Click()
Dim strTime As String
strTime = "20100808165530"
Text1.Text = Mid(strTime, 1, 4) & "-" & _
Mid(strTime, 5, 2) & "-" & _
Mid(strTime, 7, 2) & " " & _
Mid(strTime, 9, 2) & ":" & _
Mid(strTime, 11, 2) & ":" & _
Mid(strTime, 13, 2)
End Sub
Dim strDate As Date
Dim strSj As String
strSj = "20100810181015"
strSj = Mid(strSj, 1, 4) & "-" & Mid(strSj, 5, 2) & "-" & Mid(strSj, 7, 2) & " " & Mid(strSj, 9, 2) & ":" & Mid(strSj, 11, 2) & ":" & Mid(strSj, 13, 2)
strDate = CDate(strSj)
Text1 = strDate
End Sub
Private Sub Command1_Click()
Dim t As String
t = Format("20100810181015", "0000-00-00 00:00:00")
MsgBox t
End Sub
CDATE(Format("20100810181015", "0000-00-00 00:00:00"))
Dim t As String
t = Format("20100810181015", "yyyy-MM-dd hh:mm:ss")
MsgBox t
End Sub