7,762
社区成员
发帖
与我相关
我的任务
分享
Private Sub Command1_Click()
Dim s1 As String, s2 As String, s3 As String, i As Integer
s1 = "111111111111"
s2 = "年月日时分秒"
For i = 0 To Len(s1) \ 2 - 1
s3 = s3 & Mid(s1, i * 2 + 1, 2) & Mid(s2, i + 1, 1)
Next
s3 = "20" & s3
MsgBox s3
End Sub
Private Sub Command1_Click()
S = "111111111111"
For i = 1 To Len(S) - 1 Step 2
If i < 5 Then
S1 = S1 & Mid(S, i, 2) & "-"
ElseIf i = 5 Then
S1 = S1 & Mid(S, i, 2) & " "
ElseIf i > 5 Then
S1 = S1 & Mid(S, i, 2) & ":"
End If
Next
S1 = Left(S1, Len(S1) - 1)
S1 = Format(S1, "yyyy-mm-dd hh:mm:ss")
MsgBox S1
End Sub