SQL Server How to persist and use a time across different time zones

后端 未结 3 1240
不知归路
不知归路 2021-01-14 22:22

In SQL Server I would like to create a table to save time of an event, and would like to convert it into the timezone of the users choice for display purposes. Let us say th

3条回答
  •  Happy的楠姐
    2021-01-14 23:16

    The way I've solved a similar problem is to do the following:

    1. The table design is to only store GMT time.
    2. All input goes through a stored proc that requires an input of a timezone offset.
    3. The data request is to a Table-Valued Function, with an input for the timezone offset.

提交回复
热议问题