[Logo] JForum - Powering Communities
  [Search] 搜尋   [Recent Topics] 最新主題   [Hottest Topics] 熱門主題   [Top Downloads] 熱門下載   [Groups] 回首頁 
[Register] 會員註冊 /  [Login] 登入 


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

Date and time from locale RSS feed
討論區首頁 » Developer Forum
發表人 內容
jesaui


註冊時間: 2013/12/6
文章: 4
離線
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


註冊時間: 2011/6/30
文章: 250
離線
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


註冊時間: 2013/12/6
文章: 4
離線
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


註冊時間: 2013/12/6
文章: 4
離線
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,
 
討論區首頁 » Developer Forum
前往:   
行動版
Powered by JForum 2.8.3 © 2023 JForum Team • Maintained by Andowson Chang and Ulf Dittmer