I don't want to set a timezone because every device can be placed around the world where there are different timezones so i want my php script to take care of that (in the future).
The only problem is that the EPS has 1 hour and 43 minutes time difference than the current time.
PHP shows the right time but the EPS converts it "wrong" to display the correct time.
"atol" takes an integer, you are supplying a string with a formatted date and time. You need to extract the date and time values as individual tokens (strtok function) and use those to fill the "timeval" struct before setting the time.
Also, you might need to specify a time zone on the ESP in order to maintain a correct time.
I don’t want to set a timezone because every device can be placed around the world where there are different timezones so i want my php script to take care of that (in the future).
The same, the received value now from the php script (after i atol it) is 1620133653
If i paste this value directly in my code i get the same wrong time.
How can the time be wrong for 1 hour and 43 minutes, i understand that i can be wrong 1 or 2 hours because of the timezone, but not some minutes
I think it's giving incorrect time because you don't set the timezone environment variable, so maybe it uses garbage values because it's not initialized or something..
I also tried and it gives me the exact same result. I used the strtotime function because i can add multiple hours to set the timezone, but i can do that with time() as well
1620138339
160
1233
Failed to obtain time
Failed to obtain time
Failed to obtain time
Failed to obtain time
Failed to obtain time
1620138370
[ New request ] - 1620138370
1620138370
-2146627463
2007878295
Wednesday, August 17 2033 07:58:15
Where [ New request ] loads the result from time() in php