vb中如何将文本框中日期格式2012-01-01转为20120101

2024-12-27 01:46:01
推荐回答(2个)
回答1:

Private Sub Command1_Click()
MsgBox Replace(Text1, "-", "")
End Sub
Private Sub Form_Load()
Text1 = Format("20120101", "0000-00-00")
End Sub

回答2:

Private Sub Command1_Click()
MsgBox Format(Text1.Text, "YYYYMMDD")
End Sub