| Simple Simon ( @ 2007-01-12 17:03:00 |
did we learn nothing from Y2K?
So...Here I am fiddling with some code.
I happen across someone storing a date in this format:
"0611"
Would you suspect that is a date? What date might you think it to be?
I had enough context to know it was a date, but that is the way it is
stored in the database, as a string, and with the name "GE_RUN".
Excellent.
When displayed for end users, they see it as "06-11".
Now you feel better don't you? Now all ambiguity has been removed.
But, my simple code of first two characters being the year and the
last two being the month broke. Why did it break?
I will tell you.
Because sometimes it gets stored this way:
"611"
Yep. Missing the zero.
It isn't significant, I guess. But, still. If you are going to force
me to use string manipulations to get the printable version of a date,
you could please try and be consistent.
Dates and times are bad enough when people play with them poorly.
When you do crap like that you should be shot.
PS. DB design and maintenance brought to you by your friendly
neighbourhood certified Oracle DBA supported by a fat Oracle support
contract.
So...Here I am fiddling with some code.
I happen across someone storing a date in this format:
"0611"
Would you suspect that is a date? What date might you think it to be?
I had enough context to know it was a date, but that is the way it is
stored in the database, as a string, and with the name "GE_RUN".
Excellent.
When displayed for end users, they see it as "06-11".
Now you feel better don't you? Now all ambiguity has been removed.
But, my simple code of first two characters being the year and the
last two being the month broke. Why did it break?
I will tell you.
Because sometimes it gets stored this way:
"611"
Yep. Missing the zero.
It isn't significant, I guess. But, still. If you are going to force
me to use string manipulations to get the printable version of a date,
you could please try and be consistent.
Dates and times are bad enough when people play with them poorly.
When you do crap like that you should be shot.
PS. DB design and maintenance brought to you by your friendly
neighbourhood certified Oracle DBA supported by a fat Oracle support
contract.