note 39031 added to function.strtotime

From: Date: Thu, 15 Jan 2004 03:34:37 +0000
Subject: note 39031 added to function.strtotime
Groups: php.notes 
Request: Send a blank email to php-notes+get-63577@lists.php.net to get a copy of this message
There are cases where you want to convert a month number to a month name. If we assume the month number is in $i and we want month number 2 (Febuary), you can get this with: date("F", strtotime($i/1/02)) The important bit here is that $i is positioned first in the date string. You need to supply a full date to strtotime for it to work. This little hack works around this. ---- Manual Page -- http://www.php.net/manual/en/function.strtotime.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+39031 Delete -- http://master.php.net/manage/user-notes.php?action=delete+39031&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+39031&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#63577) next »