Posts

Showing posts from July, 2016

Handling Time Zone across from UI to DB

So I thought about writing a bit about handling date variables across WebAPI to Angular. The Problem When saving date / datetime values sent from the front end how do we keep the timezone information and how do we show them back on the UI. For example let's say you use a simple online note taking application. You wrote a note 8 am in the morning when you were in WA. Now you are looking at your notes from Vic and what time do you want the note to show as the created date/time ? Well I can't tell you what time you should show as it's a business case but I can tell you how to store the time information so that regardless of what time you need to show, you can achieve that. The Solution Code on GitHub  https://github.com/kumudug/DateTime-handling-Front-to-Back What the code demos...... On the WebAPI side You can store the date time values in 2 ways As UTC values in a DateTime variable in SQL Server In a DateTimeOffset variable in SQL server with...