Advertisement
ASP_Volume3 Math/ Dates #48350

Get Hours, Minutes, AND Seconds between 2 Dates (or of total seconds)

This code will enable you to take two dates, find the total seconds in between them, and calculate the Hours, Minutes, and Seconds.

AI

สรุปโดย AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

ซอร์สโค้ด
original-source
<BR><BR>
Dim H, M, S, Secs as Long<BR>
&nbsp;Secs = DateDiff("s", Date1, Date2)<BR>
&nbsp;H = Int(Secs / 3600)<BR>
&nbsp;Secs = Secs - (H * 3600)<BR>
&nbsp;M = Int(Secs / 60)<BR>
&nbsp;Secs = Secs - (M * 60)<BR>
&nbsp;S = Secs<BR>
&nbsp;MsgBox Format(H, "00") & ":" & _<BR>
&nbsp;&nbsp; Format(M, "00") & ":" & _<BR>
&nbsp;&nbsp; Format(S, "00")
ความคิดเห็นดั้งเดิม (3)
กู้คืนจาก Wayback Machine