str_to_date in mySQL
Posted by: radja (---.la.net.ua)
Date: October 10, 2016 08:29PM

Hello,

Windows 10 64
WAMP 3.0.4
APACHE 2.4.18
PHP 5.6.19
mySQL 5.7.11

I don't have a lot of experience in software development but I think that everything I do is right. So if I do something wrong please help me.

I have a problem with str_to_date in mysql. For example, if I run console and type there: "select str_to_date ('20.10.2016','%d.%m.%Y');" everything ok. But if I trying to type: "select str_to_date ('10:30','%k:%i');" I have null as result:
+-------------------------------+
| str_to_date ('10:30','%k:%i') |
+-------------------------------+
| NULL |
+-------------------------------+
1 row in set, 1 warning (0.06 sec)

I tried to make same request on hosting and it works. How to resolve this problem?

Options: ReplyQuote
Re: str_to_date in mySQL
Posted by: Otomatic (Moderator)
Date: October 10, 2016 08:48PM

Hi,

Apply Wampserver 3.0.6 Update then in Wampmanager Mysql Settings menu, put sql-mode to none.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: str_to_date in mySQL
Posted by: radja (---.customers.itsinternet.net)
Date: October 11, 2016 10:00AM

Thank you! Now str_to_date works

Options: ReplyQuote


Sorry, only registered users may post in this forum.