[Logo] JForum - Powering Communities
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Top Downloads] Top Downloads   [Groups] Back to home page 
[Register] Register /  [Login] Login 


JForum 2.8.2 is out with various fixes and improvements. Read all about it here

Date and time from locale RSS feed
Forum Index » Developer Forum
Author Message
jesaui


Joined: 2013/12/6
Messages: 4
Offline
What is the best way , to make Jforum using a locale time réference , instead of a server time :
more explicitly my hosting is in canada , but my users are mostly from europe ... I look for a time conversion method saving locale time in DB and watch locale time in GUI ?

Any suggestion , or possibility to integrate this , and extend if needeed further in Jforum

Thanks,
andowson


Joined: 2011/6/30
Messages: 239
Offline
Maybe you can do this in the following way:

Assume all data in DB are stored in server time. You can convert all timestamp to local time in server side. You'll need to get an extra parameter for user's local timezone, say local_tz, and use server timezone to add or subtract local_tz before send the final time to the front for display.
jesaui


Joined: 2013/12/6
Messages: 4
Offline
Thanks a lot
I started investigating a bit , in the way you mentionned .
Finally I only need to have the correct locale date displayed,
so just formatting the date with a timezone before displaying on the screen is enough
now problem is how to get back the local timezone of the user , in local_tz property of user
I go further ... smilie
jesaui


Joined: 2013/12/6
Messages: 4
Offline
Looking further, your solution seems the more appropriate
http://stackoverflow.com/questions/10570884/how-to-get-the-current-time-and-timezone-from-locale
so should concentrate on user input
Sy,
 
Forum Index » Developer Forum
Go to:   
Mobile view
Powered by JForum 2.8.2 © 2022 JForum Team • Maintained by Andowson Chang and Ulf Dittmer