what data type should i use for elapsed time, or a time amount??
Hi Everyone,
I'm building a time-clock type application and am wondering about what data types to use.
i'm wondering what data type to use for elapsed time, which is purely an amount of time
i.e., hours:mins:seconds:
for example: clock in at 3:15, clock out at 7:30, time elapsed is ....?
should the datatype should that be? ...datetime?, if not what then...?
If you are already storing the start and end times in the table, I would not also store the elapsed time, since that can be derived from the start/end fields. If you feel you do need to store it for any reason, then my first thought would be to just have it be an integer, where its value would probably be the number of seconds (or a float or decimal type if you want to include fractional parts of seconds).
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks