Code Convert Date
Public Shared Function convThaitoJPDate(ByVal strDate As String) As String
Dim aryTmp() As String
Dim strRtn As String
aryTmp = Split(strDate, "/")
If UBound(aryTmp) <> 2 Then
Return Nothing
Else
'strRtn = aryTmp(2) & "/" & aryTmp(1) & "/" & aryTmp(0) 'Year/Monht/Day
strRtn = aryTmp(0) & "/" & aryTmp(1) & "/" & aryTmp(2) 'Day/Monht/Year
End If
Return strRtn
End Function
ใช้ Check
Dim Day As Integer
Day= CInt(DateDiff(DateInterval.Day, CDate("01/01/2012"), CDate("01/09/2012")))