[thelist] this date in history

Renoir B. renoirb at gmail.com
Tue Sep 18 10:58:02 CDT 2012


I had to work on the timezone issue while modeling.

Solution I found was using UTC while detecting user Timezone to adjust in
the user's own.

In my case that was easy. Data is coming from LDAP and a field or two were
used to determine timezone.

In your case. I would suggest:

1.  Use GeoIP (one
<http://briancray.com/posts/find-web-visitors-location-javascript-google-api/>of
these <http://www.hostip.info/>) to detect timezone
2. Store in UTC
3. Call a service class that converts (see: using doctrine2:
here<http://docs.doctrine-project.org/projects/doctrine-orm/en/2.0.x/cookbook/working-with-datetime.html>,
here on stackoverflow<http://stackoverflow.com/questions/3757761/how-do-i-set-a-mysql-variable-time-zone-from-within-doctrine-symfony>
)

Some other references

   1. PHP The Right way on Date Time
<http://www.phptherightway.com/#date_and_time>
   2. Stack Overflow specific
question<http://stackoverflow.com/questions/5203382/how-to-automatically-detect-users-timezone>


Hope this helps :)

PS: In case you did not know. Doctrine2 and Symfony2 are going to be the
core under next
Drupal<http://symfony.com/blog/symfony-live-paris-2012-the-schedule>
and
many others (heard about joomla! too) major versions. See a bigger
perspective here<http://bergie.iki.fi/blog/my_secret_agenda_for_php_content_management_systems/>


--
Renoir Boulanger
http://renoirboulanger.com/

(envoyé de mon téléphone)
~

On 2012-09-18, at 11:01, Bob Meetin <bobm at dottedi.biz> wrote:

> so you have a site with a lot of date-specific historical content. seems
easy enough to run a query against the date and pull some data to populate
a this date in history box.
>
> well, except that the visitor (public) will probably not be in the same
timezone as the server.
>
> is there a way to do this which doesn't involve some client-side
javascript? point me...
> --
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !


More information about the thelist mailing list