Display the properties for myTimeSpan : TimeSpan : Date Time C# Examples


C# Examples » Date Time » TimeSpan »

 

Display the properties for myTimeSpan









    
using  System;

class  MainClas
{
    public  static  void  Main()
    {
        long  ticks  =  300;
        TimeSpan  myTimeSpan  =  new  TimeSpan(ticks);
        Console.WriteLine("myTimeSpan.Days  =  "  +  myTimeSpan.Days);
        Console.WriteLine("myTimeSpan.Hours  =  "  +  myTimeSpan.Hours);
        Console.WriteLine("myTimeSpan.Minutes  =  "  +  myTimeSpan.Minutes);
        Console.WriteLine("myTimeSpan.Seconds  =  "  +  myTimeSpan.Seconds);
        Console.WriteLine("myTimeSpan.Milliseconds  =  "  +  myTimeSpan.Milliseconds);
        Console.WriteLine("myTimeSpan.Ticks  =  "  +  myTimeSpan.Ticks);
        Console.WriteLine("myTimeSpan.TotalDays  =  "  +  myTimeSpan.TotalDays);
        Console.WriteLine("myTimeSpan.TotalHours  =  "  +  myTimeSpan.TotalHours);
        Console.WriteLine("myTimeSpan.TotalMinutes  =  "  +  myTimeSpan.TotalMinutes);
        Console.WriteLine("myTimeSpan.TotalSeconds  =  "  +  myTimeSpan.TotalSeconds);
        Console.WriteLine("myTimeSpan.TotalMilliseconds  =  "  +  myTimeSpan.TotalMilliseconds);
        
    }
}
    
   
  
   



Output

myTimeSpan.Days = 0
myTimeSpan.Hours = 0
myTimeSpan.Minutes = 0
myTimeSpan.Seconds = 0
myTimeSpan.Milliseconds = 0
myTimeSpan.Ticks = 300
myTimeSpan.TotalDays = 3.47222222222222E-10
myTimeSpan.TotalHours = 8.33333333333333E-09
myTimeSpan.TotalMinutes = 5E-07
myTimeSpan.TotalSeconds = 3E-05
myTimeSpan.TotalMilliseconds = 0.03


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Date Time
» TimeSpan