PHPのはgettimeofday()関数
例
現在の時刻を返します。
<?php
// Print the array from gettimeofday()
print_r(gettimeofday());
// Print the float from gettimeofday()
echo gettimeofday(true);
?>
// Print the array from gettimeofday()
print_r(gettimeofday());
// Print the float from gettimeofday()
echo gettimeofday(true);
?>
実行中のインスタンス»
定義と使用法
gettimeofday()関数は、現在の時刻を返します。
文法
gettimeofday( return_float);
参数 | 描述 |
---|---|
return_float | 可选。当设置为 TRUE 时,返回一个浮点数,而不是一个数组。默认是 FALSE。 |
技術的詳細
戻り値: | R:デフォルトは連想配列で、以下のキーを持つ配列を返します。
|
---|---|
PHPバージョン: | 4+ |
更新ログ: | PHP 5.1.0は:パラメータreturn_floatを追加しました。 |
PHPの日付/時刻のリファレンスマニュアル