Create TimeSpan from a number of seconds in CSharp
Description
The following code shows how to create TimeSpan from a number of seconds.
Example
using System;// ww w .j av a2s.c o m
class MainClass
{
static void Main( )
{
TimeSpan interval = TimeSpan.FromSeconds( 6 );
string timeInterval = interval.ToString( );
Console.WriteLine( timeInterval );
}
}
The code above generates the following result.