C# DateTimeOffset Minute

Description

DateTimeOffset Minute gets the minute component of the time represented by the current DateTimeOffset object.

Syntax

DateTimeOffset.Minute has the following syntax.


public int Minute { get; }

Example

The following example displays the minute component of a DateTimeOffset object in three different ways:


/*from   w  w w .j a  v a2  s  . c  o  m*/
using System;

public class MainClass{
  public static void Main(String[] argv){  
    DateTimeOffset theTime = new DateTimeOffset(2008, 5, 1, 10, 3, 0, 
                                               DateTimeOffset.Now.Offset);
    Console.WriteLine("The minute component of {0} is {1}.", 
                      theTime, theTime.Minute);
    
    Console.WriteLine("The minute component of {0} is{1}.", 
                      theTime, theTime.ToString(" m"));
    
    Console.WriteLine("The minute component of {0} is {1}.", 
                      theTime, theTime.ToString("mm"));
          
  }
}

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