Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Zmiana daty z "angielskiej" na "polska"
Forum PHP.pl > Forum > PHP
xeron01
Szukałem jak zmienić , lecz nigdzie nieznalazłem dokładnej odpowiedzi:
Mam kod:

Kod
header("ETag: PUB" . time());
header("Last-Modified: " . gmdate("D, d M Y H:i:s", time()-10) . " GMT");
header("Expires: " . gmdate("D, d M Y H:i:s", time() + 5) . " GMT");
header("Pragma: no-cache");
header("Cache-Control: max-age=1, s-maxage=1, no-cache, must-revalidate");
session_cache_limiter("nocache");



I chcem aby zamiast 8.23 wyswietlało 20.23 i polskie nazwy miesięcy, ktos chce poświecić chwile?
Crozin
Dlaczego chciałbyś wygenerować niepoprawny nagłówek? http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3
Zresztą masz już gotowe stałe reprezentujące odpowiednie formaty dat - http://www.php.net/manual/en/class.datetime.php
Uriziel01
Niestety tak wygenerowany nagłówek tak jak juz powiedział mój poprzednik nie będzie poprawny.
Odsyłam do linku:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

W specyfikacji tej czytamy wyraźnie:
Cytat
The format is an absolute date and time as defined by HTTP-date in section 3.3.1; it MUST be in RFC 1123 date format:

Expires = "Expires" ":" HTTP-date

An example of its use is

Expires: Thu, 01 Dec 1994 16:00:00 GMT

Note: if a response includes a Cache-Control field with the max-
age directive (see section 14.9.3), that directive overrides the
Expires field.

HTTP/1.1 clients and caches MUST treat other invalid date formats, especially including the value "0", as in the past (i.e., "already expired").


No i na koniec specyfikacja, RFC 1123:
http://www.ietf.org/rfc/rfc1123.txt
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.