last touched

Seite 1 von 1 - Forum: Coding Stuff auf overclockers.at

URL: https://www.overclockers.at/coding-stuff/last_touched_120149/page_1 - zur Vollversion wechseln!


HVG schrieb am 23.07.2004 um 18:41

ich hab auf einer site im footer eine last modified zeile die ich nicht dauernd updaten will.
wie kann ich mit php zeit und datum auslesn wann die datei zum letzten mal bearbeitet wordn is und des dann formatiert auf der seite ausgebn?


that schrieb am 23.07.2004 um 19:45

Das hier generiert einen HTTP-konformen HTTP-Header - für eine Fußzeile machst du es ähnlich und formatierst es halt wie du willst.

Code: PHP
<?
header("Last-Modified: " . gmdate("D, d M Y H:i:s", filemtime("file.html")) . " GMT");
?>


watchout schrieb am 23.07.2004 um 19:48

stichwort: "filemtime()"

edit: owned :(


HVG schrieb am 23.07.2004 um 19:53

wunnerbar, danke.
hab jetzt nur ein kleines problem. wenn ich rfc-formatiert ausgebn will passt die zeit ned. ausgebn krieg i des:
Modified: Fri, 23 Jul 2004 17:49:28 +0000
die aktuelle zeit stimmt aba :confused:


that schrieb am 23.07.2004 um 19:56

Was ist da jetzt das Problem?


watchout schrieb am 23.07.2004 um 19:58

Zitat von HVG
wunnerbar, danke.
hab jetzt nur ein kleines problem. wenn ich rfc-formatiert ausgebn will passt die zeit ned. ausgebn krieg i des:
Modified: Fri, 23 Jul 2004 17:49:28 +0000
die aktuelle zeit stimmt aba :confused:
musst du +1h (gmt) und +1h (sommer/winter) rechnen, das format dafür weiss ich jetz aber nicht auswendig....


HVG schrieb am 23.07.2004 um 19:59

naja dass ich gmt hab und cet will :)

EDIT: ok da brauch i eh nur date statt gmdate nehmen


watchout schrieb am 23.07.2004 um 20:10

Zitat von HVG
naja dass ich gmt hab und cet will :)

EDIT: ok da brauch i eh nur date statt gmdate nehmen
weisst eh' wofür das "gm" in "gmdate" steht :p


HVG schrieb am 23.07.2004 um 20:17

jetzt scho.
hab mich davor noch nie mit php beschäftigt :rolleyes:




overclockers.at v4.thecommunity
© all rights reserved by overclockers.at 2000-2026