Age frm Birthday script?

Oh no, its been doing that before the change and I can't find the problem. I installed another copy on different server and logout works. Strange.
 
Scotty_32 said:
it depends on your server which format you put it in

i think on jodos servers it goes mm/dd/yyyy

if your going to add it manually, you'll need to do:

intMemberAge = AgeCalc("01/27/1984")

if your takin it from a database, i doubt you'll need to change the format, but you can use do this to make it a correct format

dtmDOB = CDate(DateSerial(YYYY, MM, DD))

and and it should be fine

Apologies if this is completely wrong (I don't know much ASP), but this is what I've done, and it's showing nothing;

Code:
<%
 Function AgeCalc(dtmUserDOB)
       Dim intUserAge
        intUserAge = Year(Now) - Year(dtmUserDOB)
        If Month(Now) = Month(dtmUserDOB)  Then
            if Day(dtmUserDOB) > Day(NOW()) Then
            intUserAge = (intUserAge - 1)
            end if
        elseif Month(dtmUserDOB) > Month(Now) then
             intUserAge = (intUserAge - 1)
        End If
        AgeCalc    = intUserAge
 End Function
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
[COLOR=red][B][I]<code cut down>[/I][/B][/COLOR]
    <tr valign="middle">
      <td width="100" height="20" class="underl">Age :</td>
      <td height="20" class="underl"><% intMemberAge = AgeCalc("01/27/1984") %> years old</td>
    </tr>
 
<tr valign="middle">
<td width="100" height="20" class="underl">Age :</td>
<td height="20" class="underl"><% Response.Write(AgeCalc("01/27/1984")) %> years old</td>
</tr>
 
Back
Top