I'm creating a simple Content management systems to handle articles. My MS SQL Server 2008 is Located in USA, Author of information Base have reached USA and Germany.
Whenever a Author create articles within the DataBase I'd like record the DATE of creation.
I must show the date online as would really contents and content is produced from Germany.
My questions: A) - spend I personally use SYSDATETIMEOFFSET() as DEFAULT in DataBase and in the industry Logic Layer transformed into Germany time?
B) - shall I add DATE in the Business Logic Layer directly without letting the DataBase adding the datetime, and showing the information because it is?.
I really hope my real question is obvious, because I'm quite confuse about them. If you can to transmit me some link-resource I'd be thankful
Thanks men :-)
Store dates in UTC using the timezone offset, make use of this date within the application too.
Only become the neighborhood time display within the last moment.
Guidelines for datetime, daylight saving and timezones are collected in this question.
My recommendation is always to opt for UTC - by doing this you possess an absolute frame of reference.
This really is completed in SQL Server using
Store dates in certain standard amount of time in your DB, no matter time zone it came from from.
Store/calculate time zone of user, and if you display the information towards the user, convert it towards the user's timezone within the BL/Presentation Layer. Do not do it within the UI, you'll finish track of discomfort later!