Get the minute component of the time represented by the current DateTimeOffset object in CSharp
Description
The following code shows how to get the minute component of the time represented by the current DateTimeOffset object.
Example
/*from w w w . ja va2s . co 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.