Converts a time into its components.
| C# | void object.GetTimeInfo(System.DateTime Dt, out short Hours, out short Minutes, out short Seconds); |
| VB.NET | object.GetTimeInfo(ByVal Dt As Date, ByRef Hours As Short, ByRef Minutes As Short, ByRef Seconds As Short) |
| C++ | HRESULT object->GetTimeInfo(DATE Dt, short* Hours, short* Minutes, short* Seconds); |
| C | HRESULT object->raw_GetTimeInfo(DATE Dt, short* Hours, short* Minutes, short* Seconds); |
object
Dt
The time to be converted.
Hours
Returns the hours as specified by Dt.
Minutes
Returns the minutes as specified by Dt.
Seconds
Returns the seconds as specified by Dt.
The GetTimeInfo method converts a time into its components.
GetTimeInfo can be used to convert a date into its hours, minutes and seconds components. Calendar.GetDateInfo is used to retrieve the date related components.
Calendar.GetTimeInfoV is used for languages such as VBScript, which are limited by requiring Variant arguments and do not support strongly typed arguments for return values.
axSftMask1.Calendar.FormatTime(new DateTime(2000, 8, 1, 5, 1, 59), ref Text);
MessageBox.Show(Text);
short Year, Month, Day, DayOfWeek;
axSftMask1.Calendar.GetDateInfo(new DateTime(2006, 7, 14, 5, 49, 23), out Year, out Month, out Day, out DayOfWeek);
MessageBox.Show("Year=" + Year.ToString() + " Month=" + Month.ToString() + " Day=" + Day.ToString() + " DayOfWeek=" + DayOfWeek.ToString());
short Hours, Minutes, Seconds;
axSftMask1.Calendar.GetTimeInfo(new DateTime(2006, 7, 14, 5, 49, 23), out Hours, out Minutes, out Seconds);
MessageBox.Show("Hours=" + Hours.ToString() + " Minutes=" + Minutes.ToString() + " Seconds=" + Seconds.ToString());
}
AxSftMask1.Calendar.FormatTime(#5:01:59 PM#, Text)
MsgBox(Text)
Dim Year As Integer, Month As Integer, Day As Integer, DayOfWeek As Integer
AxSftMask1.Calendar.GetDateInfo(#7/14/2006 5:49:23 PM#, Year, Month, Day, DayOfWeek)
MsgBox("Year=" & Year & " Month=" & Month & " Day=" & Day & " DayOfWeek=" & DayOfWeek)
Dim Hours As Integer, Minutes As Integer, Seconds As Integer
AxSftMask1.Calendar.GetTimeInfo(#7/14/2002 5:49:23 PM#, Hours, Minutes, Seconds)
MsgBox("Hours=" & Hours & " Minutes=" & Minutes & " Seconds=" & Seconds)
End Sub
short Year, Month, Day, DayOfWeek;
m_pMask1->Calendar->GetDateInfo(COleDateTime(2000, 7, 14, 5,49,23), &Year, &Month, &Day, &DayOfWeek);
CString str;
str.Format(_T("Year=%d Month=%d Day=%d DayOfWeek=%d"), Year, Month, Day, DayOfWeek);
AfxMessageBox(str);
short Hours, Minutes, Seconds;
m_pMask1->Calendar->GetTimeInfo(COleDateTime(2000, 7, 14, 5,49,23), &Hours, &Minutes, &Seconds);
str.Format(_T("Hours=%d Minutes=%d Seconds=%d"), Hours, Minutes, Seconds);
AfxMessageBox(str);
return TRUE;
}
See Also SftMaskCalendar Object | Object Hierarchy