What CF is doing is interpretting 08/03 as August 3rd of the current year.
It automatically assumes that a date that looks like month/day is in the
current year.  When you enter something like 08/32, it gets "smart" and
says that if it can't interpret it as month/day, then maybe it's supposed
to be month/year.  I believe it actually would interpret 08/32 as Aug 1st,
1932.

I never try to interpret credit card expirations as dates, per se.  I
usually use two fields on a form and then store it as a simple string.

Jim


-----Original Message-----
From: Hondo Burney <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Monday, July 31, 2000 5:11 PM
Subject: Quirky Date Bug: MM/YY


>Sorry if this is a repost, but I looked in the archives for references to
>this bug and couldn't find any. We have customers who are inputing their
>Credit Card information into a form field. For reasons that are beyond my
>control, we can't give them a drop down to select their month and year of
>expiration. So invariably people input their data in the traditional
credit
>card date format of 08/02, or MM/YY. the problem is that Cold Fusion
>refuses to recognize this format, instead when I try and format the data,
>CF interprets the /01 as the day, not they year. So I get passed a form
>field with a string in it that is something like 08/02
>
><cfset ccDate = parseDateTime(form.creditcard_date)>
><cfset finalDate = DateFormat(ccDate, "MM/YY")>
>
>I have tried LSParseDateTime , CreateODBCDate,  and everything else I can
>think of. No matter what I do, if the form field contains data in the
form
>of 08/02, CF screws up and interprets the date as 08/00. The wierd quirk
is
>that if the year is over 31, it works, but if it's under 32, it reads it
as
>2000.  Also, it doesn't matter if I change up the dateformat to
MM/DD/YYYY
>or anything else. It still misinterprets the YY part.
>
>I would appreciate any insight into this wierd bug. I know I can just
write
>a little parser to fix the problem, but I just can't believe that CF
can't
>handle such a common credit card convention.
>
>
>---Hondo---


------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to