I am having trouble choosing the best way to process and store time measurements.
I have a text box application that allows users to enter the time in hh: mm: ss or mm: ss format.
So, I planned to parse this line, tokenize it for colons and create a TimeSpan (or use TimeSpan.Parse () and just add β00:β to the mm: ss case) for my business logic. Good?
How to store it like in a database? What will be the type of field? DateTime seems wrong. I do not want the time 00:54:12 stored as 1901-01-01 00:54:12, which seems a bit poor?
c # database datetime timespan
Dan
source share