time and dates?

  • Thread starter Thread starter Kabouter Smal
  • Start date Start date
K

Kabouter Smal

Hi!

Is there a sample or some classes to deal with time and date
calculations?
I have records that i need to calculate, the difference between the
time the clocked in and out and the time they have worked on a order
through out the day.

Please...give me some advice?
regards,
Jake.
 
Did you try subtracting one DateTime from another?
You'll get a nice TimeSpan structure.
 
Kabouter,
As Miha suggests did you look at System.DateTime and System.TimeSpan
classes?

From C# you can use the overloaded - operator to subtract two DateTimes,
while in VB.NET 2003 you need to use DateTime.Subtract. In both cases a
TimeSpan is returned.

Likewise you can add a TimeSpan to a TimeSpan to get a new TimeSpan or you
can add a DateTime to a TimeSpan to get a new DateTime.

VB.NET 2005 gains overloaded operators, so you can use - in VB.NET 2005
also.

Hope this helps
Jay
 
Thanx!!

This is what i am looking for!!

it helps me alot to comepare time and dates.
 
Back
Top