note 40831 added to function.date

From: Date: Tue, 16 Mar 2004 11:48:18 +0000
Subject: note 40831 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-66907@lists.php.net to get a copy of this message
If you have PHP<5.0 and need a W3CDTF Date in a, say, rss feed generated by php, you may use this snippet of code (mySQL-extract in the $myDate - and the <dc:date></dc:date> is the example tag (rss 2.0)): $W3CDTFdate = preg_replace( "/(\+|\-)([0-9]{2})([0-9]{2})/" ,"$1$2:$3" , date("O",$myDate)); printf("<dc:date>%sT%s%s</dc:date>" ,date("Y-m-d",$myDate) ,date("H:i:s",$myDate) ,$W3CDTFdate); ---- Manual Page -- http://www.php.net/manual/en/function.date.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+40831 Delete -- http://master.php.net/manage/user-notes.php?action=delete+40831&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+40831&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#66907) next »