VB日期追加、相差天數

dtmNyukinYmd = DateSerial(Year(dtmShimebi), Month(dtmShimebi), Day(dtmShimebi) + 7)

DateSerial: yyyy/mm/dd 格式


'''''''''''''''''''''''''
Dim outTime As String
Dim difTime As Integer

outTime = txtYoteiYmd(0).Text & txtYoteiYmd(1).Text & txtYoteiYmd(2).Text

If IsDate(Format(outTime, "####/##/##")) Then
 difTime = DateDiff("d", Now, Format(outTime, "####/##/##")) '判斷相差多少天
End If

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章