How do I store a credit card’s expiration date if it only consists of the month and year?
The date field in mysql accepts the following format: yyyy-mm-dd. An expiration date without a day is not invalid using that format.
Do I use varchar, instead? And does that not prevent me from making calculations to determine when cards expire and what not?
For Jan 2014:
It’s common to use 00 for month and day that are undefined. From the MySQL reference manual:
and later on in the manual for
DATE_FORMAT: