Quote:
|
Originally Posted by tmpuzer
Thanks. So do feel anytime you are adding a datetime column it will 99% of the time be UTC? Also, do you name your columns in any special way to indicate that it is a UTC date
|
Given my choice, all times in the database will be stored as UTC. Other than a dimension table in one rather Kimball-esque data warehouse, I've never seen the need to name columns in any way to indicate what time zone they used.
Quote:
|
Originally Posted by tmpuzer
Also, suppose I am storing a user entered date such as the date a fax was received. Currently I am storing the date only and making sure the time part is zero. How do you handle UTC with these kinds of dates? If I store UTC then the date in the system could be off by a day from the actual date, right?
|
You are basically tweaking the column in ways that don't make good sense to me... I leave data as accurate as possible within the database. I will butcher the data as necessary for presentation purposes. Since a day is a day is a day is a day, you can have the boundary anywhere you like... UTC works just as well as local time, so there is no "day error" as long as you are consistant.
In your particular example, I'd store the exact UTC time the user entered for when the fax was received. I'd make the decision of how to interpret that when I needed to make that decision, at the time of presentation. Note that this leads to all kinds of issues that your management team will need to think about, especially when comparing against deadlines (are their deadlines local or absolute?).
I've got a myriad of opinions, all completely logical to me, but none of which are impaired by the need to meet the expectations of your particular business. You'll need to apply the impairments that suit you!
-PatP