Код:
Option Explicit
Private Sub Timer1_Timer()
Dim CurrTime
Dim DestTime
Dim DiffRes
Dim iYear%, diffMonth%, iMonth%, diffDay%, iDay%, diffWeek%
Dim diffHour%, diffMin, diffSec%
Dim sTmp$, sOut$
CurrTime = Now
iYear = Year(CurrTime)
iMonth = Month(CurrTime)
iDay = Day(CurrTime)
'm d ww h n s
DestTime = DateSerial(2004, 6, 14)
DiffRes = DateDiff("m", CurrTime, DestTime)
diffMonth = CInt(DiffRes)
DiffRes = DateDiff("d", CurrTime, DateSerial(iYear, iMonth + 1, 1))
diffDay = CInt(DiffRes)
DiffRes = DateDiff("w", CurrTime, DestTime)
diffWeek = CInt(DiffRes)
DiffRes = DateDiff("h", CurrTime, DateSerial(iYear, iMonth, iDay + 1))
diffHour = CInt(DiffRes) - 1
DiffRes = DateDiff("n", CurrTime, DateSerial(iYear, iMonth, iDay + 1))
diffMin = CInt(DiffRes) - diffHour * 60 - 1
DiffRes = DateDiff("s", CurrTime, DateSerial(iYear, iMonth, iDay + 1))
diffSec = CInt(DiffRes) - (diffHour * 60 + diffMin) * 60
sOut = CStr(CurrTime) & " ===> "
sTmp = Format(diffHour, "00")
sOut = sOut & sTmp & ":"
sTmp = Format(diffMin, "00")
sOut = sOut & sTmp & ":"
sTmp = Format(diffSec, "00")
sOut = sOut & sTmp & " , " & CStr(diffWeek) & " week(s) " & CStr(diffMonth) & " month(s)"
lbl1.Caption = sOut
End Sub