Name: Anonymous 2010-02-01 17:40
I just have a quick question about calculating a timespan of sorts.
Basically I have two variables:
int depart = 0930;
int arrive = 1545;
where both are integers representing military time.
Is there a simple way to get a return value based on those integers which gives me a timespan in minutes? In the end, I need to get two separate values for hours and minutes, but I can just divide and mod the total minutes by 60 for those values.
I'm pretty new to C# and I know it has DateTime and TimeSpan stuff predefined and I'm hoping that there's a simple way to use one of those for what I need as opposed to writing an entire method from scratch
Basically I have two variables:
int depart = 0930;
int arrive = 1545;
where both are integers representing military time.
Is there a simple way to get a return value based on those integers which gives me a timespan in minutes? In the end, I need to get two separate values for hours and minutes, but I can just divide and mod the total minutes by 60 for those values.
I'm pretty new to C# and I know it has DateTime and TimeSpan stuff predefined and I'm hoping that there's a simple way to use one of those for what I need as opposed to writing an entire method from scratch