Get the seconds component of the date represented by DateTime in CSharp
Description
The following code shows how to get the seconds component of the date represented by DateTime.
Example
using System;/* ww w . j a va 2 s . c om*/
public class MainClass{
public static void Main(String[] argv){
System.DateTime moment = new System.DateTime(
1999, 1, 13, 3, 57, 32, 11);
// Second gets 32.
int second = moment.Second;
System.Console.WriteLine(second);
}
}
The code above generates the following result.