1

I am working on an online appointment booking system using SQL server 2012 and Asp.Net MVC with Entity Framework and right now I am a bit confused about storing date time in database.

My implementation scenarios are

a) User should be able to book an appointment by specifying a preferred date and time.

b) User can cancel an appointment 24 hours before the appointment time.

c) He should be able to login and start a video session on the specified date and time of appointment.

It is a web application so user's may connect from different timezone and it is also possible that a user may book an appointment in one timezone and can move to another timezone.

What is the industry standard for handling date and time using .Net in this scenario?.

  • The suggested answers on [this](https://stackoverflow.com/questions/832986/how-to-work-with-time-zones-in-asp-net) doesn't covers DST time. – Khaleelullah Sep 05 '17 at 14:03
  • That dup post is not good, but also your question is too broad. Please read [this](https://stackoverflow.com/questions/2532729/daylight-saving-time-and-time-zone-best-practices) and [this](https://stackoverflow.com/a/19627330/634824) for better practices, then if you still need help please ask a more specific question. Thanks. – Matt Johnson-Pint Sep 05 '17 at 22:46

1 Answers1

1

I can't comment on industry standard / best practice, but it's worth noting that Entity Framework/.NET/SQL Server support a data type called DateTimeOffset, which stores the date/time as well as the time zone offset (e.g. UTC+8). It is straightforward in C# to convert a DateTimeOffset value into a specified time zone.

David P
  • 761
  • 8
  • 13