How to get the days for the date

后端 未结 3 545
天涯浪人
天涯浪人 2021-01-13 21:50

Part 1

Dim totdays as long
totdays = DateDiff(\"d\", \"01/2011\", DateAdd(\"m\", 1, \"01/2011\"))

The above code will retu

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-13 22:11

    You can use DateSerial Function in VB6 to convert a string or integer variable to Date Variable

    Dim d As String
    Dim datevar As Date
    d = "31"
    datevar = DateSerial(2011,1, Val(d))   
    MsgBox Format(datevar,"DDDD dd/MMM/yyyy")
    

提交回复
热议问题