C# TimeSpan FromDays
Description
TimeSpan FromDays
returns a TimeSpan that represents
a specified number of days, where the specification is accurate to the nearest
millisecond.
Syntax
TimeSpan.FromDays
has the following syntax.
public static TimeSpan FromDays(
double value
)
Parameters
TimeSpan.FromDays
has the following parameters.
value
- A number of days, accurate to the nearest millisecond.
Returns
TimeSpan.FromDays
method returns An object that represents value.
Example
The following example creates several TimeSpan objects using the FromDays method.
// w w w . j a va 2 s. c o m
// Example of the TimeSpan.FromDays( double ) method.
using System;
class FromDaysDemo
{
static void Main( )
{
TimeSpan interval = TimeSpan.FromDays( 0.000123456 );
string timeInterval = interval.ToString( );
Console.WriteLine( timeInterval );
}
}
The code above generates the following result.