c# - .Net 2.0 - System.DateTimeOffset Best practice -


we have old database stores date , time smalldatetime. date , times generated different applications code:

syste.datetime appointmentdate = system.datetime.now; 

we want migrate database make timezone independed. decided use sql datetimeoffset data type because comes need. stores utc date , offset... perfect.

unfortunately have extremely old applications based on .net 2.0. there no system.datetimeoffset.

what best way develop timezone awareness application in .net 2.0?

  1. store milliseconds since 1970-01-01 long data type in database , convert system.datetime in our application? lose timezone
  2. store date , time smalldatetime in our database use system.datetime.utcnow generate date , time on client side? lose timezone too.

background our migration question: azure app service - datetime changes during sync

any ideas?


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -