PDA

View Full Version : get month from datestamp string


jasonc310771
02-02-2008, 11:25 AM
the following does not show the month in the string.

what am i doing wrong.

thanks


<?
$submitgmtdatetime = "2008-02-02 01:40:54";
echo(date("m",$submitgmtdatetime));
?>

Ludatha
02-02-2008, 12:58 PM
<?php
echo date(" F ");
?>


<?
$submitgmtdatetime = "2008-02-02 01:40:54";
echo(date(" F ",$submitgmtdatetime));
?>

Does that work?

jasonc310771
02-02-2008, 03:52 PM
nope it still shows the 12 or december should be showing February or 02

Mwnciau
02-02-2008, 06:06 PM
That should be:

<?
$submitgmtdatetime = strtotime ( "2008-02-02 01:40:54" );
echo date ( " F ", $submitgmtdatetime );
?>