c# - Using DateTime for a duration of time e.g. 45:00 -
i'd know if possible use datetime type durations such 45:00 (45 minutes) or 120:00 (120 minutes). these values need stored local sql server db. if possible, possibly hint how done using datetime, or if not let me know way done using different type.
thank in advance, jamie
you should use timespan structure
timespan interval = new timespan(0, 45, 0); console.writeline(interval.tostring());
for database storing part, store property ticks because specific constructor timespan structure allows instantiate new timespan passing ticks value
long ticks = gettimespanvaluefromdb(); timespan interval = new timespan(ticks);
i wish add need bigint t-sql
datatype field store long net
datatype
Comments
Post a Comment