指定された値が日付と時刻であるかどうかを確認します。
構文
@IsTime(value:any) : int
パラメータ |
説明 |
value |
確認する値。スカラ値または配列のいずれかを指定することができます。 |
戻り値 |
説明 |
boolean |
パラメータで指定された値が日付と時刻の場合は 1、日付と時刻ではない場合は 0。 |
例
以下の例では、指定された値が数値、テキスト、日付のいずれであるかを確認しています。
function p(stuff) {
print("<<<" + stuff + ">>>");
}
function printType(value) {
p(value + " is typeof " + typeof(value));
if(@IsNumber(value)) p(value + " is number");
else p(value + " is not number");
if(@IsText(value)) p(value + " is text");
else p(value + " is not text");
if(@IsTime(value)) p(value + " is time");
else p(value + " is not time");
}
printType("some text");
printType(9.8);
printType(new Number(9.9));
printType("4/1/06 12:01");
printType(new Date(2006, 3, 1, 12, 1));