While testing the Mod_CollapseCats, which I created, I found an error in date display when the Time format is 12 Hours. The 0 from the hour is truncated if the time is between 1 PM and 9.59.59PM. The date and time are stored as string in the database as below
"20010625135959". The last 6 digits referring to Time 135959. This will display as 1:59:59 PM in 12 HR time format.
I have implemented the following solution to correct this error:
I made changes in the inc_functions.asp as below:
Find this line in your inc_functions.asp (about or near line 725)
function ChkTime(fTime)
function ChkTime(fTime)
if fTime = "" then
exit function
end if
if strTimeType = 12 then
if cint(Mid(fTime, 9,2)) > 12 then
ChkTime = ChkTime & " " & _
(cint(Mid(fTime, 9,2)) -12) & ":" & _
Mid(fTime, 11,2) & ":" & _
Mid(fTime, 13,2) & " " & "PM"
elseif cint(Mid(fTime, 9,2)) = 12 then
I modified it as below:
if strTimeType = 12 then
if cint(Mid(fTime, 9,2)) > 12 then
if cint(Mid(fTime, 9,2)) > 21 then
ChkTime = ChkTime & " " & _
(cint(Mid(fTime, 9,2)) -12) & ":" & _
Mid(fTime, 11,2) & ":" & _
Mid(fTime, 13,2) & " " & "PM"
else
ChkTime = ChkTime & " 0" & _
(cint(Mid(fTime, 9,2)) -12) & ":" & _
Mid(fTime, 11,2) & ":" & _
Mid(fTime, 13,2) & " " & "PM"
end if
elseif cint(Mid(fTime, 9,2)) = 12 then
It works okay. But I have not tested if it will have any side effects. Chances are less. If anyone has a better idea. I think there might be a method to avoid truncation of zero. Left side zero is being truncated.
GauravBhabu
There is only one miracle...That is LIFE!