note 101508 modified in function.strtotime by danbrown

From: Date: Tue, 21 Dec 2010 17:47:58 +0000
Subject: note 101508 modified in function.strtotime by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-175112@lists.php.net to get a copy of this message
strtotime is awesome for converting dates. in this example i will make an RSS date, an ATOM date, then convert them to a human readable m/d/Y dates. <?php $rss = date("r"); $atom = date("c"); $human1 = date('m/d/Y', strtotime($rss)); $human2 = date('m/d/Y', strtotime($atom)); echo $rss."<br />".$atom."<br />".$human1."<br />".$human2; ?> --was-- strtotime is awesome for converting dates. in this example i will make an RSS date, an ATOM date, then convert them to a human readable m/d/Y dates. $rss = date("r"); $atom = date("c"); $human1 = date('m/d/Y', strtotime($rss)); $human2 = date('m/d/Y', strtotime($atom)); echo $rss."<br />".$atom."<br />".$human1."<br />".$human2; http://php.net/manual/en/function.strtotime.php

« previous php.notes (#175112) next »