hijri date format to mysql (invalid range) -


here table structure:

+-------+----------+------+-----+---------+-------+ | field | type     | null | key | default | | +-------+----------+------+-----+---------+-------+ | id    | int(11)  | no   |     | null    |       | | date  | datetime | no   |     | null    |       | +-------+----------+------+-----+---------+-------+ 

there query insert date in table:

insert tbl_temp set id = 3, date = '1392-01-01'; 

query run succeeds:

here if run query of:

   insert tbl_temp set id = 3, date = '1392-02-31'; 

result shows value out of range, how can set column value of date format, here can set column text or varchar data, later need set trigger regarding date need column type date>

note: problem , date column has type of date (so in gregorian) take date (0001-01-01) (any) must according date fromat. in application using hijri need insert hijri date (1393-02-31) date not in range of gregorian date) not allow data database.

any solution insert date mysql column of table . regards

i found mysql server not supporting hijri date there 2 options:

  1. application level customization: column date type, have varchar, or text , hijri input application input text , store text database,

  2. database level customization: have keep database in gregorian date type , manage date changing in application view.

as far of date(the column type datetime, date 1392-02-31 not in range of gregorian date reject , keep null.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -