Server Time incorrect - where is the offset?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Server Time incorrect - where is the offset?

a@kid
My server time that's appearing in the user preferences Time Zone  
panel (and that is also being used when writing to page_touched in  
the db) is incorrect. It's several hours ahead of the timestamp i get  
from date('YmdHis') in php or CURRENT_TIME() in mysql.

I have looked everywhere to try to find out where the offset is  
coming from but with no luck. I don't have either $wgLocaltimezone or  
$wgLocalTZoffset set so i know that these are not the culprits.

Does anyone know why my server time is being offset?
What other places should i look?

thanks

_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Server Time incorrect - where is the offset?

Brion Vibber
a@kid wrote:
> My server time that's appearing in the user preferences Time Zone  
> panel (and that is also being used when writing to page_touched in  
> the db) is incorrect. It's several hours ahead of the timestamp i get  
> from date('YmdHis') in php or CURRENT_TIME() in mysql.

Did you try gmdate('YmdHis')? It should give the current UTC time.

-- brion vibber (brion @ pobox.com)


_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l

signature.asc (257 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Server Time incorrect - where is the offset?

a@kid
In reply to this post by a@kid
Thanks a lot Brian.

My server is in a different timezone than i am, and i had just  
assumed that MediaWiki was storing timestamps in the server's  
timezone. When i use UTC everything seems to work fine ...

except ...

I am in EDT so i should be -5 hours from  UTC. But in the preferences  
Time Zone panel it says that i am only 4 hours behind the server even  
though it is correctly displaying my local time. Is this an error in  
my localsettings?


Just to make sure i understand what's going on with dates and times...

MediaWiki stores all timestamps in UTC.
So gmdate('YmdHis') should be the same as $dbr->timestamp() ?

thanks again
/
_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Server Time incorrect - where is the offset?

a@kid
In reply to this post by a@kid
Thanks a lot Brian.

My server is in a different timezone than i am, and i had just  
assumed that MediaWiki was storing timestamps in the server's  
timezone. When i use UTC everything seems to work fine ...

except ...

I am in EDT so i should be -5 hours from  UTC. But in the preferences  
Time Zone panel it says that i am only 4 hours behind the server even  
though it is correctly displaying my local time. Is this an error in  
my localsettings?


Just to make sure i understand what's going on with dates and times...

MediaWiki stores all timestamps in UTC.
So gmdate('YmdHis') should be the same as $dbr->timestamp() ?
/

_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Server Time incorrect - where is the offset?

Brion Vibber
a@kid wrote:
> I am in EDT so i should be -5 hours from  UTC. But in the preferences  
> Time Zone panel it says that i am only 4 hours behind the server even  
> though it is correctly displaying my local time. Is this an error in  
> my localsettings?

It's daylight saving time. :)

> Just to make sure i understand what's going on with dates and times...
>
> MediaWiki stores all timestamps in UTC.
> So gmdate('YmdHis') should be the same as $dbr->timestamp() ?

Yes. The one 'exception' is times embedded into text with signatures (~~~~)
which is in the system timezone. You can override that usually by setting the TZ
variable or setting $wgLocalTimezone.

You can also change the default local timezone offset, which will be used for
the display of times for anonymous visitors and new accounts. (This is the
offset that can be changed in Preferences). There should be a FAQ entry on this
which links a couple pages with more detail on time options.

-- brion vibber (brion @ pobox.com)


_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l

signature.asc (257 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Server Time incorrect - where is the offset?

a@kid
In reply to this post by a@kid

"It's daylight saving time. :)"

lol :)

Thanks for your help brian.

_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l