NYCPHP Meetup

NYPHP.org

[nycphp-talk] Timezone handling php : Mangesh Sathe

David Krings ramons at gmx.net
Tue Aug 2 13:18:22 EDT 2011


Hi!

Years ago I was looking into the a similar issue and one way is to run a 
Javascript on the client side that returns the GMT bias of the 
client...assuming they set it correctly. The script reads it from a cookie 
that gets written.
It is from a (still unfinished) project and this part is years old, so my 
memory as to how exactly it works is fading. The JavaScript part is also not 
my invention, I received that from someone on this list.

The attached file contains a function that creates a heading for a page. The 
time displayed in the heading is the time of the client, but based off the 
server time. So the client's time is irrelevant as long as the GMT bias is 
correctly set and, of course, the server has the correct time and local bias.

I hope you can follow the handful of lines of code and hopefully it helps with 
what you try to accomplish.

David


On 8/2/2011 12:13 PM, mangesh sathe wrote:
> Hello everyone ,
>
> Need some help from you.
>
> Suppose someone is Writing an article like newspaper article. If user who is
> in London wrote one article & set publish date & time according to UK timezone ,
> Now another user who is in Tokyo wrote one article & set publish date & time
> according to Japan timezone,
>
> so how can i publish/make available their articles with respect to their timezone?
>
> Please give me some guidance on php timezone handling..
>
> Thanks in advance.
> Mangesh Sathe
>
>
>
>
>
> _______________________________________________
> New York PHP Users Group Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> http://www.nyphp.org/Show-Participation
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20110802/a90a344d/attachment.html>


More information about the talk mailing list