Hey All,
I'm working on a little "countdown to a certain date" code (found here).
After searching this forum for the last couple of hours, I'm confused about
the regional settings.
I've read stuff about Bulgarian settings, this Format, that Format, you should
Format, you shouldn't Format. I just don't want people in other countries
to have any problems.
My questions are...
1. Does the Now function always return the Short Date format? (it does for
me)
2. Is there anything wrong with the code below? (works for me)
VB Code:
'Dim sEnd As String Dim sEnd As Date Private Sub Timer1_Timer() 'Dim sStart As String Dim sStart As Date Dim sLabel As String Dim lDays&, lHours&, lMinute&, lSeconds& 'sStart = Now sStart = CDate(Now) lSeconds = DateDiff("s", sStart, sEnd) lDays = lSeconds \ 3600 \ 24 lHours = lSeconds \ 3600 Mod 24 lMinute = ((lSeconds Mod 3600) \ 60) lSeconds = ((lSeconds Mod 3600) Mod 60) sLabel = "Time left: " & _ lDays & " days " & _ lHours & " hours " & _ lMinute & " minutes " & _ lSeconds & " seconds" Label1.Caption = sLabel End Sub Private Sub Form_Load() 'sEnd = Format(Date, "Short Date") sEnd = CDate(Fix(Now)) sEnd = DateAdd("d", 2, sEnd) Timer1.Enabled = True End Sub
Thanks in advance,
Ron




Reply With Quote