C# TimeSpan UnaryPlus

Description

TimeSpan UnaryPlus returns the specified instance of TimeSpan.

Syntax

TimeSpan.UnaryPlus has the following syntax.


public static TimeSpan operator +(
  TimeSpan t
)

Parameters

TimeSpan.UnaryPlus has the following parameters.

  • t - The time interval to return.

Returns

TimeSpan.UnaryPlus method returns The time interval specified by t.

Example

The following example applies the UnaryPlus operator to several TimeSpan objects.


using System;//  w w  w  .  ja v  a  2  s .  c om

class MainClass
{
    static void Main( )
    {
        TimeSpan Left = new TimeSpan( 2, 0, 0 );

        Console.WriteLine( + Left);
    } 
} 

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