By every description of the problem I read I understand that there is only one misinterpretation of how to use the date.
My understanding is that the server is on time, at least your examples match the time of Brazil at the time you post. You are interpreting that the time is in GMT which is the universal time, but the server time is in the time Brazil\East
, he’s using the -0200
. GMT uses the 0000
. How the server interprets that it is in GMT, any attempt to use another Timezone will currently result in 2 hours of error. So if the server time is already the time you want, you cannot use another Timezone other than the GMT.
Another possible interpretation is that the server time is wrong, since it is with Brazil time but is indicating that the time is GMT. In fact, strictly speaking, it is wrong. When you say precisely at 18:09 of the Brazilian time that your server shows 18:09 GMT
indicates that it is wrong, because at 18:09 Brazilian time the correct GMT is 20:09.
You have some options:
- If you want to use the Brazilian time on the server Timezone from the server to be BRST (you will need to adjust to BRT when summer time is over, if the server does not automatically).
- If you want to keep the use of GMT, put the right time of the now, put the London time and not ours.
- Or still leave it the way it is and stop configuring other software to use another Timezone, since what’s on the server is exactly the time you want. I mean, stop setting up PHP, whether in
ini
, be with the function date_default_timezone_set
.
The latter solution is not the most correct one. If you have some software you cannot control the Timezone, will give problem. In compensation is the only form of poorly made software that does not consider the Timezone function properly.
See a server with everything correct (despite the time not being there so well synchronized at the time I tested :) ).
I put in the Github for future reference.
What do you call "server time is in order"? That it is in UTC time, ie GMT, which is in universal time? Well, if so, the time shown is also correct. 15:45 GMT equals 13:35 BRST. Either you need to convert or use the actual server time on the TZ you want. You did not show used codes to indicate how you got the results you spoke so I can not detail more.
– Maniero
The code used is a simple PHP date() . The server is in GMT(Tue Jan 20 18:09:28 GMT 2015).. maybe that would be it?
– Douglas Galico
Exactly, the server is on time, the return is on time, the only thing wrong is the interpretation of the time. If there’s time I’ll come up with an answer on this.
– Maniero
It would be good to inform what is the clock difference of the motherboard also, for comparison purposes (usually available when setting up the BIOS or equivalent).
– Bacco
PS: Not directly related to this problem, but virtualized machines can make a difference in minutes as well, depending on how clock timing is set up. (Normally this should be done by the virtualization environment instead of conventional NTP).
– Bacco
@Bacco that is the explanation for the error I speak at the end of my answer.
– Maniero