移動先: 概要 戻り値 キーワード. フラグ. MEL 例.

概要

date [-date] [-format string] [-shortDate] [-shortTime] [-time]

date は 「元に戻す」が不可能「照会」が不可能「編集」が不可能 です。

カレント タイムと日付の情報を返します。定義済みフォーマットまたは -format フラグで出力フォーマットを指定します。

戻り値

string

キーワード

time, date

フラグ

date, format, shortDate, shortTime, time
ロング ネーム(ショート ネーム) 引数型 プロパティ
-time(-t) create
カレント タイムを返します。フォーマットは hh:mm:ss です。
-shortTime(-st) create
カレント タイムを返します。フォーマットは hh:mm です。
-date(-d) create
カレントの日付を返します。フォーマットは YYYY/MM/DD です。
-shortDate(-sd) create
カレントの日付を返します。フォーマットは MM/DD です。
-format(-f) string create
日付と時間の表示方法を定義する文字列を指定します。以下のキーワードの出現場所は、すべて対応する値に置換されます。 YYYYYYMMDDhhmmss
キーワード置換後
カレントの年(4 桁)
カレントの年(下 2 桁)
カレントの月。該当する場合、先頭に 0 が追加されます。
カレントの日。該当する場合、先頭に 0 が追加されます。
カレントの時間。該当する場合、先頭に 0 が追加されます。
カレントの分。該当する場合、先頭に 0 が追加されます。
カレントの秒。該当する場合、先頭に 0 が追加されます。

: コマンドの作成モードで使用可能なフラグ : コマンドの編集モードで使用可能なフラグ
: コマンドの照会モードで使用可能なフラグ : 1 つのコマンドで複数回使用可能なフラグ

MEL 例

// Get the current date and time
date;
// Result:2006/03/09 16:50:24//
// Get only the month and day
date -shortDate;
// Result:03/09//
// Get the date and time in a fancy format
date -format "Year is YY (or YYYY), month is MM, day is DD. And it is now hh:mm:ss";
// Result:year is 06 (or 2006), month is 03, day is 09. And it is now 16:53:20//