4

I'm getting below error for my magento1 site.

Unknown date format, neither date nor time in 'yyyy-MM-dd HH:mm:ss' found

I have followed below article but it is not working, article comment shows that it is not the right answer.

https://kuldeepdeveloper.blogspot.com/2016/08/magento-unknown-date-format-neither.html

The issue is in \lib\Zend\Locale\Format.php on line 827 but I don't know how to solve it. If I remove this code it work for some pages.

$day   = iconv_strpos($format, 'd');
$month = iconv_strpos($format, 'M');
$year  = iconv_strpos($format, 'y');
$hour  = iconv_strpos($format, 'H');
$min   = iconv_strpos($format, 'm');
$sec   = iconv_strpos($format, 's');
  • We have M1 like 20 websites all are facing this issue, none of the given ideas are helping, All of them are showing this error since 5 May 2020. – Sahil May 5 at 9:27
6

We are facing the same problem (logging into the backend). What is very strange:

  1. M1 (not only 1.9) shops are facing this problem / no M2-shops
  2. Only one of our hoster / server is having this problem - M1 shops on other hosters servers are running. (We are in contact with the hoster whether there has been an automatic update of the PHP Zend module. I will keep you updated.)
  3. The problem suddenly appears from 05. May 2020 without changes on the shops or on the server

Edit with current solution: I've edited the /lib/Zend/Locale/Format.php replacing all iconv_strpos with strpos and it works for now.

Edit of the Edit: We replaced it with mb_strpos now which should be better for unicode characters.

Promised update on the server update: It seems that there have been some updates but whatsoever it would not make sense to downgrade any module in order to keep the shop running. So changes on the shop in order to comply with the updated requirements make more sense INMHO.

| improve this answer | |
  • Do you know how to solve it. you are right – Jaimin May 5 at 9:18
  • worked ... but after replacing all iconv_strpos with strpos you have to edit line 1113 to replace back strpos with iconv_strpos to avoid issue with 4 parameters sent to strpos ... also this is temporary fix as is not recommended to change core files – Eugen May 5 at 10:05
  • We did another change using mb_strpos instead of strpos which will be better with unicode characters. @Eugen: I do not see any issue related to line 1113. I've just replaced ALL iconv_strpos to mb_strpos. But I agree that this is a quick fix only. As well as I do not think downgrading the PHP Zend module is a solution as well. – Commercers May 5 at 10:14
  • Thank you, Website is now working again. But the currency symbol and commas are still not showing on prices, even with "mb_strpos" – Jagoman May 5 at 12:22
  • @Jagoman Can you tell me where exactly? I do not see this problem. Neither in Front- nor Backend. – Commercers May 5 at 12:24
5

Same here, the error appears from may 5th, withouth any changes on the server.

I tried replacing all iconv_strpos with strpos in \lib\Zend\Locale\Format.php, which seems to be working in my case.

| improve this answer | |
  • worked ... but after replacing all iconv_strpos with strpos you have to edit line 1113 to replace back strpos with iconv_strpos to avoid issue with 4 parameters sent to strpos ... also this is temporary fix as is not recommended to change core files – Eugen May 5 at 10:06
  • @Eugen In which function is that? I don't have strpos (or iconv_strpos) on row 1113. – Punchlinern May 5 at 11:15
1

I fix this new Magento 1.9 problem! You need downgrade server Zend PHP modul to: (10.4.) if you use new version: 27.4. this issues with PHP Zend modul version!

| improve this answer | |
1

We believe that this issue is caused by server side updates, we think specifically cPanel.

You should talk to your hosting provider or server manager. So you should not start changing core code.

| improve this answer | |
0

Change with

$day   = iconv_strpos($format, 'd',0,'UTF-8');
$month = iconv_strpos($format, 'M',0,'UTF-8');
$year  = iconv_strpos($format, 'y',0,'UTF-8');
$hour  = iconv_strpos($format, 'H',0,'UTF-8');
$min   = iconv_strpos($format, 'm',0,'UTF-8');
$sec   = iconv_strpos($format, 's',0,'UTF-8');
| improve this answer | |
  • I have tried this as per the article but it is not working. I have changed this and added iconv_set_encoding("internal_encoding","UTF-8"); iconv_set_encoding("output_encoding", "ISO-8859-1"); code in index.php as well – Jaimin May 5 at 9:15
0

I to have that problem, i have 3magento website with last version and all have that problem. This not help: https://kuldeepdeveloper.blogspot.com/2016/08/magento-unknown-date-format-neither.html

| improve this answer | |
  • if we remove that date format code then website will work for homepage – Jaimin May 5 at 9:21
  • you think comment that parth of code: // $day = iconv_strpos($format, 'd'); // $month = iconv_strpos($format, 'M'); // $year = iconv_strpos($format, 'y'); // $hour = iconv_strpos($format, 'H'); // $min = iconv_strpos($format, 'm'); // $sec = iconv_strpos($format, 's'); that not help for me. I use different stuff on my website. – mile May 5 at 9:23
  • yes but it is not right solution. also in my cast account page and cms page are working – Jaimin May 5 at 9:24

Not the answer you're looking for? Browse other questions tagged or ask your own question.