DateTime je suvise nezgodan za ovu primenu jer ukljucuje i obavezan datum. Predrag ti je dao deo resenja, preko TimeStampa, sa tim sto mozes komotno da koristis operatore + i - koje timestamp podrzava da sabiras i oduzimas vremena:
Code:
TimeSpan x1 = TimeSpan.Parse("12:11");
TimeSpan x2 = TimeSpan.Parse("2:15");
TimeSpan add = x1 + x2;
TimeSpan sub = x1 - x2;
Console.WriteLine(add);
Console.WriteLine(sub);
Izlaz:
14:26:00
09:56:00
▪ "Why isn't my wireless mouse connected to the computer?" - 2008 Dumbest Technical Support Question award
▪ The word 'politics' is derived from the word 'poly', meaning 'many', and the word 'ticks', meaning 'blood sucking parasites' - Larry Hardiman
▪ If the good guy gets the girl, it's rated PG; if the bad guy gets the girl, it's rated R; and if everybody gets the girl, it's rated X