This question already has an answer here:
这个问题在这里已有答案:
- How to store repeating dates keeping in mind Daylight Savings Time 1 answer
- 如何存储重复日期,记住夏令时1回答
For a scheduling system, what's the best way to save the timezone of client/event in a central server database coming from multiple sources mobile,web,client app.
对于调度系统,将来自多个源移动,Web,客户端应用程序的*服务器数据库中的客户端/事件的时区保存的最佳方法是什么。
- How do you store the dates? Alarms, reminders etc...
- 你如何存储日期?警报,提醒等......
- How do you handle the DST setting?
- 你如何处理夏令时设置?
- How do you handle the events if client has traveled to a different location?
- 如果客户已经前往不同的地方,您如何处理事件?
I need the solution to work with all databases in tags.
我需要解决方案来处理标签中的所有数据库。
4 个解决方案
#1
5
These are the key points to the strategy I tend to use.
这些是我倾向于使用的策略的关键点。
- Every date is UTC internally to the system.
- 每个日期都是系统内部的UTC。
- Users are shown dates in the their local timezone.
- 用户在其本地时区显示日期。
- We allow users to override the timezone they are using in case they travel and they want to keep the timezone consistent.
- 我们允许用户覆盖他们旅行时使用的时区,并且他们希望保持时区一致。
- Make the timezone easily visible. Either display it with the time or as part of the column header.
- 使时区易于看到。要么随时间显示,要么作为列标题的一部分显示。
#2
8
Everything in UTC, and another column for the offset.
UTC中的所有内容,以及偏移量的另一列。
#3
3
Store dates as UTC timestamps - convert to local time when displaying data to the user.
将日期存储为UTC时间戳 - 在向用户显示数据时转换为本地时间。
#4
0
- Safe to store in one specific time zone ideally in UTC
- 可以安全地存储在理想情况下以UTC为单位的特定时区
- If you store the time with a date, you are safe in DST.
- 如果您使用日期存储时间,则在夏令时是安全的。
- Suggesting you to use a web service to find the time difference.
- 建议您使用Web服务查找时差。
#1
5
These are the key points to the strategy I tend to use.
这些是我倾向于使用的策略的关键点。
- Every date is UTC internally to the system.
- 每个日期都是系统内部的UTC。
- Users are shown dates in the their local timezone.
- 用户在其本地时区显示日期。
- We allow users to override the timezone they are using in case they travel and they want to keep the timezone consistent.
- 我们允许用户覆盖他们旅行时使用的时区,并且他们希望保持时区一致。
- Make the timezone easily visible. Either display it with the time or as part of the column header.
- 使时区易于看到。要么随时间显示,要么作为列标题的一部分显示。
#2
8
Everything in UTC, and another column for the offset.
UTC中的所有内容,以及偏移量的另一列。
#3
3
Store dates as UTC timestamps - convert to local time when displaying data to the user.
将日期存储为UTC时间戳 - 在向用户显示数据时转换为本地时间。
#4
0
- Safe to store in one specific time zone ideally in UTC
- 可以安全地存储在理想情况下以UTC为单位的特定时区
- If you store the time with a date, you are safe in DST.
- 如果您使用日期存储时间,则在夏令时是安全的。
- Suggesting you to use a web service to find the time difference.
- 建议您使用Web服务查找时差。