having problems formating dates please help been working and reading for days trying 
to fix this. With certain dates month and day get reversed. I have no control over 
2003win server global settings

I made an html page to show problem. In the page copy and past the dates into left box 
and click right box for function to occur.



To test page just copy this code into notepad and save as what ever you want to call 
page.html



Here is the code



code begin----------------->

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<script Language="VBScript">
Function ExaminationDate_onblur()

 Set theForm = document.DriverCert
 Dim strdtDate
 Dim strYear
 Dim strDay
 Dim strMonth
 Dim strFinalDate
 
 If ((theForm.ExaminationDate.value)<> "") Then
 
  strdtDate = (theForm.ExaminationDate.value)

    varDate = FormatDateTime(strdtDate, [dddd/mmmm/yyyy])
'Extract the year
strYear = year(varDate)

'Extract the month and then make sure it has 2 digits using the len function
strMonth = month(varDate)
lenMonth = len(strMonth)
   If lenMonth = 1 Then
      strMonth = "0" & strMonth
   end if

'Extract the day and then make sure it has 2 digits using the len function
strDay = day(varDate)
lenDay = len(strDay)
   If lenDay = 1 Then
      strDay = "0" & strDay
   end if

'Now put it all together in a nice little format
strFinalDate = strDay & "/" & strMonth & "/" & strYear
  
     theForm.CertificationExpiry.value = strFinalDate

 end if
  
end Function
Function CertificationExpiry_onblur()

 Set theForm = document.DriverCert
 Dim strdtDate
 Dim strYear
 Dim strDay
 Dim strMonth
 Dim strFinalDate
 
 If ((theForm.ExaminationDate.value)<> "") Then
  
  strdtDate = (theForm.ExaminationDate.value)

    varDate = FormatDateTime(strdtDate, [dddd/mmmm/yyyy])
'Extract the year
strYear = year(varDate)

'Extract the month and then make sure it has 2 digits using the len function
strMonth = month(varDate)
lenMonth = len(strMonth)
   If lenMonth = 1 Then
      'strMonth = "0" & strMonth
   end if

'Extract the day and then make sure it has 2 digits using the len function
strDay = day(varDate)
lenDay = len(strDay)
   If lenDay = 1 Then
      'strDay = "0" & strDay
   end if

'Now put it all together in a nice little format
strFinalDate = strDay & "/" & strMonth & "/" & strYear  
     theForm.CertificationExpiry.value = strFinalDate

 end if
 
end Function

</script>
</head>

<body>

<form method="POST" action="--WEBBOT-SELF--" name="DriverCert">
 <!--webbot bot="SaveResults" U-File="_private/form_results.csv" S-Format="TEXT/CSV" 
S-Label-Fields="TRUE" -->
 &nbsp;<p align="center">Enter these test values notice with certain dates 
 month and day get reversed<br></p>
 <table cellpadding="0" cellspacing="0" width="658" height="73">
  <!-- MSTableType="layout" -->
  <tr>
   <td width="329" height="73" valign="top">date formats 
dd/mm/yyyy<p>01/02/2003<br>02/02/2003<br>03/02/2003<br>04/02/2003<br>05/02/2003<br>06/02/2003<br>07/02/2003<br>08/02/2003<br>09/02/2003<br>
 10/02/2003<br>11/02/2003<br>12/02/2003<br>13/02/2003<br>14/02/2003</td>
   <td width="329" height="73" valign="top">date formats 
dd/mm/yyyy<p>01/12/2003<br>02/11/2003<br>03/10/2003<br>04/09/2003<br>05/08/2003<br>06/07/2003<br>07/06/2003<br>08/05/2003<br>09/04/2003<br>
 10/03/2003<br>11/02/2003<br>12/01/2003<br>&nbsp;</p>
   <p>&nbsp;</td>
  </tr>
 </table>
 <p>&nbsp;enter date here&gt;&gt;<input type="text" name="ExaminationDate" 
size="20">&nbsp; 
 click here to make onblur occure &gt;&gt;<input type="text" 
name="CertificationExpiry" size="20"> </p>
</form>

</body>

</html>

<-------------code end


[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to