Way to store dates with missing days/months in mysql (php)
Posted
by Paul M
on Stack Overflow
See other posts from Stack Overflow
or by Paul M
Published on 2010-06-09T22:15:10Z
Indexed on
2010/06/09
22:22 UTC
Read the original article
Hit count: 111
I want to store dates in mysql so I set the table to be of type 'Date', which is fine but mysql requires that the full date is provided YYYY-MM-DD.
However some of my data does not include day and some is missing the month. Now I could just use a varchar(10) field, but then its difficult to run date based queries on the data.
Is there another date format which is not as strong and would allow me to use ?? or 00 where the day/month is not known?
© Stack Overflow or respective owner