DateAndTime.Now 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
會回傳一個根據你的系統顯示的當前日期和時間值。
public:
static property DateTime Now { DateTime get(); };
public static DateTime Now { get; }
static member Now : DateTime
Public ReadOnly Property Now As DateTime
屬性值
根據你的系統,這是目前的日期和時間。
範例
以下範例利用 屬性 Now 回傳當前系統日期與時間。
Dim ThisMoment As Date
' The following statement calls the Get procedure of the Visual Basic Now property.
ThisMoment = Now
備註
要設定系統日期,請使用該 Today 屬性。 要設定系統時間,請使用屬性。TimeOfDay