Stim=20170915102515
Or etim=20170915101515
How to evaluate difference how many seconds
CodePudding user response:
The DateDiff functionhttps://www.yiibai.com/vba/vba_datediff_function.html
CodePudding user response:
Dim stimStr As String, etimStr As String
Dim stim As the Date, or etim As Date
StimStr="20200915102515"
EtimStr="20190916101515"
Stim=CDate (Format (stimStr, "0000-00-00 00:00:00"))
Or etim=CDate (Format (etimStr, "0000-00-00 00:00:00"))
The Debug. Print stim
The Debug. Print or etim
The Debug. Print "seconds interval:"; DateDiff (" s ", stim, or etim)
Interval: Debug. Print "points"; DateDiff (" n ", stim, or etim)
The Debug. Print "interval."; DateDiff (" h ", stim, or etim)
The Debug. Print "day interval:"; DateDiff (" d ", stim, or etim)
The Debug. Print "month interval:"; DateDiff (" m ", stim, or etim)
Interval: Debug. Print "years"; DateDiff (" yyyy ", stim, or etim)
CodePudding user response: