What is the best field to store the birthday?

后端 未结 5 797
我在风中等你
我在风中等你 2021-02-01 17:41

I have to store in my mysql database, the users\'s birthday ( like 12-11-1990 ).

What field type do I have to use to store it ?

5条回答
  •  离开以前
    2021-02-01 17:56

    "DATE" should be good.

    The DATE type is used for values with a date part but no time part. MySQL retrieves and displays DATE values in 'YYYY-MM-DD' format. The supported range is '1000-01-01' to '9999-12-31'.

    More details : http://dev.mysql.com/doc/refman/5.5/en/datetime.html

提交回复
热议问题