[Skip to main content](#vessel-content)

#   Date/time error message on checkout

##

- **[gmarsh](/forum/user/6659-gmarsh "View gmarsh's Profile")**
- [![gmarsh's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/6659-gmarsh "View gmarsh's Profile") Topic Author
- [ Offline](/forum/user/6659-gmarsh)

Less More

- Posts: 15
- Thank you received: 0
-
-

12 years 1 month ago [\#170665](#170665) by [gmarsh](/forum/user/6659-gmarsh "View gmarsh's Profile")  *[Date/time error message on checkout](/forum/27-checkout/870950-date-time-error-message-on-checkout#170665 "-- url of the page with the problem -- :   sat.kahworld.org/index.php/2012-03-12-23...3-57/product/listing  -- HikaShop version -- : 2.3.2 -- Joomla version -- : 2.5.24 -- PHP version -- : 5.3.28 -- Browser(s) name and version -- : unknown - customer -- Error-message(debug-mod must be tuned on) -- : 500 - DateTime::&#95;&#95;construct() &#91;datetime.--construct&#93;: Failed to parse time string (09-28-2014) at position 0 (0): Unexpected character  Haven't had this error before. But a customer's order failed on checkout because of it. There are no dates associated with products, only two custom fields. No problems with it in 2 years of operation.  Thoughts? Gary")* was created by *[gmarsh](/forum/user/6659-gmarsh "View gmarsh's Profile")*

-- url of the page with the problem -- : [ sat.kahworld.org/index.php/2012-03-12-23...3-57/product/listing](http://sat.kahworld.org/index.php/2012-03-12-23-14-04/2012-03-12-23-23-57/product/listing)
-- HikaShop version -- : 2.3.2
-- Joomla version -- : 2.5.24
-- PHP version -- : 5.3.28
-- Browser(s) name and version -- : unknown - customer
-- Error-message(debug-mod must be tuned on) -- : 500 - DateTime::__construct() [datetime.--construct]: Failed to parse time string (09-28-2014) at position 0 (0): Unexpected character

Haven't had this error before. But a customer's order failed on checkout because of it. There are no dates associated with products, only two custom fields. No problems with it in 2 years of operation.

Thoughts?
Gary

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3MDk1MC1kYXRlLXRpbWUtZXJyb3ItbWVzc2FnZS1vbi1jaGVja291dD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

12 years 1 month ago [\#170677](#170677) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Date/time error message on checkout](/forum/27-checkout/870950-date-time-error-message-on-checkout#170677 "-- url of the page with the problem -- :   sat.kahworld.org/index.php/2012-03-12-23...3-57/product/listing  -- HikaShop version -- : 2.3.2 -- Joomla version -- : 2.5.24 -- PHP version -- : 5.3.28 -- Browser(s) name and version -- : unknown - customer -- Error-message(debug-mod must be tuned on) -- : 500 - DateTime::&#95;&#95;construct() &#91;datetime.--construct&#93;: Failed to parse time string (09-28-2014) at position 0 (0): Unexpected character  Haven't had this error before. But a customer's order failed on checkout because of it. There are no dates associated with products, only two custom fields. No problems with it in 2 years of operation.  Thoughts? Gary")*

Hi,

Please edit the file "administrator/components/com_hikashop/classes/field.php" and replace Code:

JPluginHelper::importPlugin('hikashop'); $dispatcher = JDispatcher::getInstance(); $dispatcher-&gt;trigger('onFieldDateDisplay', array($field-&gt;field_namekey, $field, &amp;$value, &amp;$map, &amp;$format, &amp;$size));

By Code:

if(HIKASHOP_J25 &amp;&amp; !empty($value) &amp;&amp; $field-&gt;field_options['format'] != "%Y-%m-%d") { $seps = preg_replace('#[a-z0-9%]#iU','',$field-&gt;field_options['format']); $seps = str_replace(array('.','-'),array('\.','\-'),$seps); $mConv = false; $yP = -1; $mP = -1; $dP = -1; $i = 0; foreach(preg_split('#['.$seps.']#', $field-&gt;field_options['format']) as $d) { switch($d) { case '%y': case '%Y': if($yP&lt;0) $yP = $i; break; case '%b': case '%B': $mConv = true; case '%m': if($mP&lt;0) $mP = $i; break; case '%d': case '%e': if($dP&lt;0) $dP = $i; break; } $i++; } $elems = preg_split('#['.$seps.']#', $value); $value = @$elems[$yP] . '-' . @$elems[$mP] . '-' . @$elems[$dP]; $app = Jfactory::getApplication(); if($app-&gt;isAdmin()) { $app-&gt;enqueueMessage('Since Joomla 2.5.24 it is not possible anymore to change the format of dates. If you need a different format, please use the advanced datepicker type of custom field.'); } $format = "%Y-%m-%d"; $field-&gt;field_options['format'] = $format; } if(HIKASHOP_J25 &amp;&amp; !empty($value)) { try{ JHTML::_('date', $value, null, null); }catch(Exception $e) { $value = ''; } } JPluginHelper::importPlugin('hikashop'); $dispatcher = JDispatcher::getInstance(); $dispatcher-&gt;trigger('onFieldDateDisplay', array($field-&gt;field_namekey, $field, &amp;$value, &amp;$map, &amp;$format, &amp;$size));

It will manage the bug introduced in Joomla 2.5.24 and Joomla 3.3

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

The following user(s) said Thank You: [gmarsh](/forum/user/6659-gmarsh "View gmarsh's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3MDk1MC1kYXRlLXRpbWUtZXJyb3ItbWVzc2FnZS1vbi1jaGVja291dD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[gmarsh](/forum/user/6659-gmarsh "View gmarsh's Profile")**
- [![gmarsh's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/6659-gmarsh "View gmarsh's Profile") Topic Author
- [ Offline](/forum/user/6659-gmarsh)

Less More

- Posts: 15
- Thank you received: 0
-
-

12 years 1 month ago [\#170693](#170693) by [gmarsh](/forum/user/6659-gmarsh "View gmarsh's Profile")  Replied by *[gmarsh](/forum/user/6659-gmarsh "View gmarsh's Profile")* on topic *[Date/time error message on checkout](/forum/27-checkout/870950-date-time-error-message-on-checkout#170693 "-- url of the page with the problem -- :   sat.kahworld.org/index.php/2012-03-12-23...3-57/product/listing  -- HikaShop version -- : 2.3.2 -- Joomla version -- : 2.5.24 -- PHP version -- : 5.3.28 -- Browser(s) name and version -- : unknown - customer -- Error-message(debug-mod must be tuned on) -- : 500 - DateTime::&#95;&#95;construct() &#91;datetime.--construct&#93;: Failed to parse time string (09-28-2014) at position 0 (0): Unexpected character  Haven't had this error before. But a customer's order failed on checkout because of it. There are no dates associated with products, only two custom fields. No problems with it in 2 years of operation.  Thoughts? Gary")*

Thank you for the prompt help! Much appreciated!
Gary

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3MDk1MC1kYXRlLXRpbWUtZXJyb3ItbWVzc2FnZS1vbi1jaGVja291dD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.105 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
