C# TimeSpan Seconds

Description

TimeSpan Seconds gets the seconds component of the time interval represented by the current TimeSpan structure.

Syntax

TimeSpan.Seconds has the following syntax.


public int Seconds { get; }

Example

The following example creates several TimeSpan objects and displays the Seconds property of each.


using System;/*from   w w  w  .  j a v  a  2 s .co m*/

class TimeSpanPropertiesDemo
{
    static void Main( )
    {
        TimeSpan ts = new TimeSpan( 98712345678 );
        Console.WriteLine(ts.Seconds);
    } 
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version