Skip to content
Advertisement

Failed to parse time string at position 41 (i): Double timezone specification

I’m using the jquery daterangepicker, which in turn uses the jQuery datapicker.

My Ubuntu system works fine. The browser is sending a parseable string:

JavaScript

Outputs:

JavaScript

On our testers Windows system, the browser is sending an expanded timezone in the string:

JavaScript

Throws and exception:

JavaScript

I’ve googled around and can’t find any resources on this specific PHP error.

I’m “solving” this problem by striping out the bracketed text which returns the same results:

JavaScript

This seems pretty bad to do and I’m looking for suggestions on how to do this properly.

Advertisement

Answer

Using DateTime::createFromFormat() as Marc B suggested seems to be a better solution.

What I’ve ended up with is:

JavaScript

Which outputs the correct date now:

JavaScript

The + at the end of the format is the magic that makes this work.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement