Calendar.GetDateTime 方法

定義

根據此 Calendar 物件的元件,建置日期和時間。

public:
 virtual DateTime GetDateTime() = GetDateTime;
DateTime GetDateTime();
public System.DateTimeOffset GetDateTime();
function getDateTime()
Public Function GetDateTime () As DateTimeOffset

傳回

DateTime,代表此行事曆的日期和時間。

備註

如果您使用 .NET 語言 (例如 C# 或 Visual Basic) ,則如果您想要遵循這組步驟,請使用國際標準時間 (UTC) 時區與 Calendar 物件。

如果您未使用國際標準時間 (UTC) 時區, 則 GetDateTime 會擲回例外狀況,因為計算的刻度數目會低於或因時區位移而溢位。

適用於

另請參閱