ALLOW_INVALID_DATES (1.8.3)

Problems with the Windows version of XAMPP, questions, comments, and anything related.

ALLOW_INVALID_DATES (1.8.3)

Postby irandoct » 13. September 2013 09:46

Hi,
I'm using Hijri Shamsi date (Persian). ( first 6 months are 31 days, and next 6 months are 30 days, and almost every 4 years we have a leap year)
so i can not add date value like 1392-02-30 or 1392-02-31. the mysql save my date value as "0000-00-00"!
how may i change "ALLOW_INVALID_DATES" setting in xampp 1.8.3 to fix this problem?!
Thanks
Mansour
irandoct
 
Posts: 2
Joined: 13. September 2013 09:35
Operating System: windows

Re: ALLOW_INVALID_DATES (1.8.3)

Postby JJ_Tagy » 13. September 2013 10:44

Hello Mansour,

In order to store Lunar, you must convert the date. There are many scripts available. Here is one with an explanation: http://redacacia.me/2010/08/16/coding-i ... -calendar/
JJ_Tagy
 
Posts: 678
Joined: 30. January 2012 13:44
Operating System: Windows 10 Pro x64

Re: ALLOW_INVALID_DATES (1.8.3)

Postby irandoct » 13. September 2013 10:51

Hi JJ_Tagy,
Thank you for your reply. i provided a hijri shamsi popup calendar before. Now, my problem is related to MYSQL configuration!
Mysql does NOT permit me add dates like 1390-02-30 , 1392-06-31... etc ! mysql convert these dates to 0000-00-00!
I searched for issue and it's solution ! i found new mysql validate date value by default!
if i set ALLOW_INVALID_DATES in mysql configuration the problem should be resolved!
Any idea/solution?

Regards
Mansour
irandoct
 
Posts: 2
Joined: 13. September 2013 09:35
Operating System: windows

Re: ALLOW_INVALID_DATES (1.8.3)

Postby JJ_Tagy » 13. September 2013 12:43

That sounds like it could work. Up to you how you want to store. It doesn't necessarily need to be stored in date format. You can store as number and retrieve number to convert back to Hijri.
JJ_Tagy
 
Posts: 678
Joined: 30. January 2012 13:44
Operating System: Windows 10 Pro x64

Re: ALLOW_INVALID_DATES (1.8.3)

Postby Altrea » 13. September 2013 14:22

Hi,

AFAIK you need a Persian Date conversion function.
http://forums.mysql.com/read.php?103,50 ... msg-506368

If you don't want that i would not use the Type DATE because on invalide entrys the DATE functions will fail too, so use something like VARCHAR(10).

best wishes,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8286
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 28 guests