| |||||
DateTime.Hour PropertySystem Namespace DateTime Structure Returns the hour component of the date represented by this instance. [ VB ] <Serializable> Public ReadOnly Property Hour As Integer [ C# ] [ Serializable ] public int Hour { get; } [ C++ ] [ Serializable ] public: __property int get_Hour ( ); [ JScript ] public Serializable function get Hour ( ) : int; Property ValueThe hour, between 0 and 23. ExampleThe below code snippet demonstrates using the Hour 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 |
| ||||
Check out related books at Amazon
© 2000-2008 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 aspxtreme