関数リファレンス/current time

出典: WordPress Codex 日本語版

このページ「関数リファレンス/current time」は 情報が古くなっている可能性があります。最新版英語)も合わせてご覧ください。最新に更新してくださる協力者を求めています

説明

current_time関数

現在の時間、またはタイムスタンプを戻り値としてリターンします。

使用方法

<?php echo current_time($type, $gmt = 0); ?>
引数の書式 

$type = 文字列型かつ"mysql"または"timestamp"

使用例

現在のシステムの時間を2種類のフォーマットで取得する。

<?php echo('Current time: ' . current_time(mysql) . '<br />'); ?>
<?php echo('Current timestamp: ' . current_time(timestamp)); ?>
Current time: 2005-08-05 10:41:13
Current timestamp: 1123238473

最新英語版: WordPress Codex » Function Reference/current time

他の言語