Option to saving and not saving UTC time in Azure Table

♀尐吖头ヾ 提交于 2021-02-11 12:13:56

问题


It seems to me that Azure Table always saves UTC time to the table. Even the date type has time zone, e.g. DateTimeOffset.

Is there an option to save original time, instead of UTC time?


回答1:


Is there an option to save original time, instead of UTC time?

If you are looking to save the data as Edm.DateTime, then the answer is no. That data is always stored as UTC.

From this link about Edm.DateTime:

A 64-bit value expressed as Coordinated Universal Time (UTC). The supported DateTime range begins from 12:00 midnight, January 1, 1601 A.D. (C.E.), UTC. The range ends at December 31, 9999.

One option for you could be to save the local date/time as String type data or convert the local date/time value to ticks and save that as Int64 and then do the conversion in your application.



来源:https://stackoverflow.com/questions/62725583/option-to-saving-and-not-saving-utc-time-in-azure-table

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!