會員註冊 / 登入  |  電腦版  |  Jump to bottom of page

Developer Forum » Date and time from locale

發表人: jesaui
10 年 前
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
10 年 前
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
10 年 前
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
10 年 前
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,




會員註冊 / 登入  |  電腦版  |  Jump to top of page