asp.net.ph

DateTime.Second Property

System Namespace   DateTime Structure


Returns the seconds component of the date represented by this instance.

[ VB ]
<Serializable>
Public ReadOnly Property Second As Integer

[ C# ]
[ Serializable ]
public int Second { get; }

[ C++ ]
[ Serializable ]
public: __property int get_Second ( );

[ JScript ]
public Serializable
function get Second ( ) : int;

Property Value

The seconds, between 0 and 59.

Example

The below code snippet demonstrates using the Second property.

[ VB ]
Dim moment As New System.DateTime ( 1999, 1, 13, 3, 57, 32, 11 )

' Year gets 1999.
Dim year As Integer = moment.Year

' Month gets 1 ( January ).
Dim month As Integer = moment.Month

' Day gets 13.
Dim day As Integer = moment.Day

' Hour gets 3.
Dim hour As Integer = moment.Hour

' Minute gets 57.
Dim minute As Integer = moment.Minute

' Second gets 32.
Dim second As Integer = moment.Second

' Millisecond gets 11.
Dim millisecond As Integer = moment.Millisecond

[ C# ]
System.DateTime moment = new System.DateTime (
                        1999, 1, 13, 3, 57, 32, 11 );
// Year gets 1999.
int year = moment.Year;

// Month gets 1 ( January ).
int month = moment.Month;

// Day gets 13.
int day = moment.Day;

// Hour gets 3.
int hour = moment.Hour;

// Minute gets 57.
int minute = moment.Minute;

// Second gets 32.
int second = moment.Second;

// Millisecond gets 11.
int millisecond = moment.Millisecond;
See Also

DateTime Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph