I just thought i'd make a post to see how many have this issue with shared hosting..
Basically, when retrieving my data from MySQL, you need timezone info:
Code: Select all
$result = $mysqli->query("SET time_zone='Europe/London'");
However, I cannot use that, because the time zone tables are not loaded in to MySQL. So, the way I can only get it to work is by using
Code: Select all
$result = $mysqli->query("SET time_zone='+00:00'"); or $result = $mysqli->query("SET time_zone='+01:00'");
But this messes up my sunshine graphs due to clocks going back and forward throughout the year. For example: If in May, I record sunshine from, 5am to 6am, and then call it back, it could show as 4am to 5am due to BST. You can fix it by using +01:00, but then you have the issue of sunshine in the evening being one hour out and vice versa. The Europe/London way fixes this problem. The hosting i'm using now refuses to load the time zone tables in to MySQL because it is shared hosting. I have asked another 5 hosting companies, and they all say the same thing! The only answer is to move to a dedicated server, but i'm not paying £30 a month for overkill hardware to host my simple weather site.
I don't know how i can get past this problem! I didn't have the problem with GoDaddy, but I had to ditch them, as it they were slow and I used to get so many issues with them, and I prefer SSD hosting. So I refuse to ever go back with them. So I think i'm completely stuck?!