YYYYMMDD格式的字符串如何转换为日期? Hi,我有以一个字符串类型存储的日期,格式为YYYYMMDD,请问把它转换为日期类型,请问如何做?例如:DIM A as stringDIM B as dateA=“20071208”B=CDATE(A) ! <-- 如何做?谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Private Sub Command1_Click() Dim str As String Dim temp As String str = "20050511-010225" temp = Left(str, 4) & "-" & Mid(str, 5, 2) & "-" & Mid(str, 7, 2) & " " & Mid(str, 10, 2) & ":" & Mid(str, 13, 2) & ":" & Right(str, 2) Text1.Text = CDate(temp) End Sub 见http://topic.csdn.net/t/20050513/09/4003272.html DIM A as string DIM B as date A=“20071208” B=CDATE(format(A,"0000/00/00")) VB中如何调用Delphi创建的DLL(输入输出数组参数)? 累加和计算 高分求,《Microsoft Visual Basic 6.0 分布式应用程序开发》电子书 在vb 中调用vc写的dll时如果函数参数是char *,怎么处理? 关于操作注册表? 为什么我提的问题总是没人能回答得上来. 怎样获得EXCEL工作表的行数? 谁能提供一个权限管理的的思路,或者参考程序,谢谢! 从DBF表中提取图片的问题! 用winsock控件,传送数据库表的问题。 vb+SQL SERVER实现网络数据库问题 label里写的字,如何使字居中~~
Dim str As String
Dim temp As String
str = "20050511-010225"
temp = Left(str, 4) & "-" & Mid(str, 5, 2) & "-" & Mid(str, 7, 2) & " " & Mid(str, 10, 2) & ":" & Mid(str, 13, 2) & ":" & Right(str, 2)
Text1.Text = CDate(temp)
End Sub 见
http://topic.csdn.net/t/20050513/09/4003272.html
DIM B as date
A=“20071208”
B=CDATE(format(A,"0000/00/00"))