- It takes just 1 byte. Hence it saves storage.
- Date arithmetic can be applied without a conversion. Hence, it saves processor time.
- The reference point is well defined and unique. Hence, everyone can select the right attribute value for an event without any background knowledge (at least if you are a country that is using Gregorian calendar).
- Visualization and analytical tools automatically treat a "year" attribute as a temporal variable. That saves user's time.
pondělí 30. května 2016
In what data type to store year?
If you are using MySQL, use "year" data type, if possible. The reasons follows: