-1

I can't get my head around the strtotime() function. I'm working with PHP 7.2.4 and want to parse some date and time strings. Following screenshot was taken in debug mode in PHPStorm:

Screenshot PHPStorm

As seen in the screenshot the grey date values show the same format. But exactly the one I programmatically parse is "suddenly" not valid. I've trimmed the string and everything is in UTF8.

Did I miss something?

The answer came instantly as wrote the question...

ptr2n0
  • 83
  • 13
  • 1
    https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-on-so-when-asking-a-question – Andreas Jun 05 '18 at 06:38
  • @Andreas Thanks for pointing out. But in my case it seems not necessary as the picture inherits all information without the necessity to reproduce. But if it has to be I'll paste it anyway. Let me know. – ptr2n0 Jun 05 '18 at 07:39
  • You didn't read did you? Lets try again https://meta.stackoverflow.com/a/285557/5159168 – Andreas Jun 05 '18 at 07:45

1 Answers1

0

Answering my own question
Well, it just came to mind why it is not working: Microsoft uses UTF-8 with BOM by default if something is encoded in UTF8

I've created a file programmatically with C# and encoded it with System.Text.Encoding.UTF8. This encodes with BOM by default. So, for every beginner working with Microsoft Windows, be aware of the encoding of your files you parse later.
My problem was solved then by this solution: Create Text File Without BOM

Hope this helps someone else.

ptr2n0
  • 83
  • 13