Weird Date this a flaw?

Results 1 to 2 of 2

Thread: Weird Date this a flaw?

  1. #1
    dclark Guest

    Default Weird Date this a flaw?

    OK, I formated an Access 97 date field as m/d/yyyy.<BR><BR>When I return the date value to my ASP page, it will return a two digit year format (m/d/yy) for dates between the years of 1930 and 2030.<BR><BR>Any date before 1930 and after 2030 will return a four digit year format (m/d/yyyy).<BR><BR>Anybody know why? Maybe I have too much time on my hands, but thought someone just might need to know.

  2. #2
    omc Guest

    Default RE: Weird Date this a flaw?

    There was a posting last week that explained how to format the date exactly as you want it. This is quoted from that message...<BR><BR>Here is a little Function that will do it for you..<BR>Just call it the PadDate(YourDate). The function does not check for a valid date, so besure<BR>YourDate is valid first.<BR>&#060;%<BR>Function PadDate(OriginalDate)<BR>OriginalDay = DatePart("d", OriginalDate)<BR>OriginalMonth = DatePart("m", OriginalDate)<BR>NewYear = Right(DatePart("yyyy", OriginalDate), 2)<BR><BR>If OriginalDay &#060;= 9 Then<BR>NewDay = "0" & OriginalDay<BR>Else<BR>NewDay = OriginalDay<BR>End If<BR><BR>If OriginalMonth &#060;= 9 Then<BR>NewMonth = "0" & OriginalMonth<BR>Else<BR>NewMonth = OriginalMonth<BR>End If<BR><BR>PadDate = NewMonth & "/" & NewDay & "/" & NewYear<BR>End Function<BR>%&#062;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts