Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Zmiana daty z "angielskiej" na "polska"
xeron01
post
Post #1





Grupa: Zarejestrowani
Postów: 14
Pomógł: 0
Dołączył: 30.11.2011

Ostrzeżenie: (0%)
-----


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?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
Crozin
post
Post #2





Grupa: Zarejestrowani
Postów: 6 476
Pomógł: 1306
Dołączył: 6.08.2006
Skąd: Kraków

Ostrzeżenie: (0%)
-----


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

Ten post edytował Crozin 8.12.2011, 21:32:46
Go to the top of the page
+Quote Post
Uriziel01
post
Post #3





Grupa: Zarejestrowani
Postów: 307
Pomógł: 37
Dołączył: 9.11.2010
Skąd: Zielona Góra

Ostrzeżenie: (0%)
-----


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

Ten post edytował Uriziel01 9.12.2011, 10:27:09
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 19:43