Should we support `Date` type?
Describe This Problem
Date is a common type in database, should we support it ?
Every row here must contain timestamp, Date type seems a bit redundant, but some information(such as birthday) seems more appropriate to express by Date?
Proposal
- Use i32/i64 to store date32/date64 like arrow.
- Add necessary conversions like other defined types.
- Format it in response.
Additional Context
No response
It is great if Date is supported, and we can leave this feature for volunteers in the community.
I am try. pls assign me.
I am try. pls assign me.
The proposal is a little bit simple, and any discussion is welcome when you have any difficulty in implementing this feature.
- A date. The supported range is '1000-01-01' to '9999-12-31'. MySQL displays DATE values in 'YYYY-MM-DD' format.See:https://dev.mysql.com/doc/refman/8.0/en/date-and-time-type-syntax.html
- But permits assignment of values to DATE columns using either strings or numbers. like: STR_TO_DATE,SUB_DATE,See:https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_str-to-date
@MachaelLee
But permits assignment of values to DATE columns using either strings or numbers
For such conversion, I guess we already have an example for that -- converting string date literal to timestamp literal.
@MachaelLee
But permits assignment of values to DATE columns using either strings or numbers
For such conversion, I guess we already have an example for that -- converting string date literal to timestamp literal.
It is not common that converting string date literal to timestamp literal. Usually we convert timestamp to date with cast( timestamp as date); sometimes we convert date to unixtimetamp with UNIX_TIMESTAMP(), it returns the value of the argument as seconds since '1970-01-01 00:00:00' UTC.