douke6027 2013-09-25 10:43
浏览 33
已采纳

PHP / MySQL - 存储用于跨时区的日期选择报告的日期

currently debating the best way to proceed with regard to storing dates and would appreciate experienced comments - looking for the 'why' rather than the 'how'.

Scenario:

We are developing a system that allows clients (across multiple timezones) to create transactional data. At sign-up the client will have nominated their timezone. A large part of the system revolves around the client running date and time related reports on the transactional data.

We have read numerous questions and comments regarding the best way to store the transactional date field and most say store as UTC and then perform various date and time related functions to work out the time in the various timezones in order to run the selection reports.

Our question is - why go to all the trouble of storing in UTC - what is the advantage of storing the date in UTC. From our point of view we have the client's nominated timezone so if we store the date/time in their correct timezone then it’s a calculation that we run once per transaction - thereafter all their reporting will work without any date transforming calculations.

As most of the questions and comments we have read refer to the 'How' we think there must be something about the 'Why' that we have missed.

So, in summary, before we make our decision have we missed something - is there an absolute 'must store dates as UTC' reason?

Thanks for reading - any comments appreciated.

  • 写回答

3条回答 默认 最新

  • dongtuoleng8624 2013-09-25 10:57
    关注

    No, in my opinion there is no 'must' in this! this is totally a design issue, what you choose to use will determine the way the things will work, in either case, it's just a referencing issue, the people who are suggesting the use of UTC, is because it is the well known and verified reference, and no matter how big your program becomes or where your clients are, the reference is always there, but if you use, another time zone, things will work the same way but the time zone you choose will be the reference, which may cause misunderstanding in some situations, but still, in a controlled environment it's totally the same. I hope I answered your question.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)
  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。