TimeSpan total properties
In this chapter you will learn:
Use TimeSpan total properties
Total...
properties return values of type double describing the entire time span.
using System;/*java 2s . c o m*/
using System.Text;
class Sample
{
public static void Main()
{
TimeSpan ts = TimeSpan.FromDays(10) - TimeSpan.FromSeconds(1);
Console.WriteLine(ts.TotalDays);
Console.WriteLine(ts.TotalHours);
Console.WriteLine(ts.TotalMinutes);
Console.WriteLine(ts.TotalSeconds);
Console.WriteLine(ts.TotalMilliseconds);
}
}
The output:
Next chapter...
What you will learn in the next chapter:
Home » C# Tutorial » Date, Time, TimeZone