Convert date format

Closed
Wong - Mar 2, 2011 at 06:26 PM
 rich - Mar 2, 2011 at 07:12 PM
Hello,

How to change date format from 72310 to 100723 ?
Thanks in advance!

Regards,
Wong

Related:

1 response

in vba:

Dim strMonth As String
Dim strDay As String
Dim strYear As String
Dim strDATEVALUE As String
Dim strNewDate As String

strDATEVALUE = "72310"
strYear = Right(strDATEVALUE, 2)
strDay = Left(Right(strDATEVALUE, 4), 2)
strMonth = Replace(strDATEVALUE, strDay & strYear, "")
strNewDate = strYear & String(2 - Len(strMonth), "0") & strMonth & strDay

MsgBox strNewDate
0