You are here: strftime() bug? « PHP Programming Language « IT news, forums, messages
strftime() bug?

Posted by Schraalhans Keukenmeester on 03/25/07 12:11

Below the function I use to write notes to a log file, and some example
output. Somehow some lines have a differently formatted timestamp. I
have no clue as to what may cause this.
(Code ran on my host's production (shared) server, CentOS, Apache
2.0.52, PHP5.0.4)
Anyone an idea what's the most likely culprit?

My code:

function logwrite($note) {
$filename = '/tmp/phpscripts.log';
if (!$logfile = fopen($filename,'a'))
die("Could not open $logfile.");
$str = strftime('%c')." : ".$note;
fwrite($logfile,$str);
fclose($logfile);
}

Contents of example logfile
Sun Mar 25 13:24:30 2007 : Pageview...
Sun Mar 25 13:24:32 2007 : Pageview...
Sun Mar 25 13:37:25 2007 : Pageview...
Sun Mar 25 13:37:25 2007 : Pageview...
Sun 25 Mar 2007 01:56:19 PM CEST : Pageview...
Sun 25 Mar 2007 01:56:19 PM CEST : Pageview...
Sun Mar 25 13:56:25 2007 : Pageview...
Sun Mar 25 13:56:32 2007 : Pageview...
Sun 25 Mar 2007 01:56:43 PM CEST : Pageview...
Sun Mar 25 13:56:55 2007 : Pageview...

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация