PHP Velho Oeste 2024

http_date

(PECL pecl_http >= 0.1.0)

http_dateHTTP の RFC に準拠した日付を作成する

説明

string http_date ([ int $timestamp ] )

RFC 1123 に準拠した、妥当な形式の HTTP 日付を作成します。 Wed, 22 Dec 2004 11:34:47 GMT のような形式になります。

パラメータ

timestamp

Unix タイムスタンプ。省略した場合は現在時刻。

返り値

HTTP の日付を文字列で返します。

参考

  • date() - ローカルの日付/時刻を書式化する

add a note add a note

User Contributed Notes 1 note

up
-1
joshsnyder at earthlink dot net
15 years ago
Not sure if this is a failure of documentation or a bug, but it is worth noting that this function seems to return the timestamp of the script execution by default, not the current time. So e.g. this:

<?php

echo http_date();
sleep(60);
echo
http_date();

?>

will output the exact same string twice.
To Top