Location: PHPKode > projects > FeedMeLinks, Social BookmarkingSince2002 > feedmelinks.com/testing/date.php
<pre>
SAMPLE: 20020303183547
   PHP: <%= date("YmdHis") %>

SUBSTR: <%= substr( "20020303183547", 0, 8 ) %><br/>
   PHP: <%= date("YmdHis") %>

yesterday
<%
	$mysql_date = "20020303183547";
	$date_date = "2002-03-03";
%>

mysql_date: <%= $mysql_date %>

date_date: <%= $date_date %>


date( $mysql_date ): 
<%= substr( $mysql_date, 0, 4 ) . "-" . substr( $mysql_date, 4, 2 ) . "-" . substr( $mysql_date, 6, 2 ) %>


strtotime( $mysql_date ): 
<%= strtotime( substr( $mysql_date, 0, 4 ) . "-" . substr( $mysql_date, 4, 2 ) . "-" . substr( $mysql_date, 6, 2 ) ) %>


strtotime( $mysql_date ) - 1 day: 
<%= strtotime( substr( $mysql_date, 0, 4 ) . "-" . substr( $mysql_date, 4, 2 ) . "-" . substr( $mysql_date, 6, 2 ) ) - 
(1 * 24 * 60 * 60)%>


date( strtotime( mysql_date ) - 1 day ): 
<%= date( "Y-m-d", strtotime( substr( $mysql_date, 0, 4 ) . "-" . substr( $mysql_date, 4, 2 ) . "-" . substr( $mysql_date, 6, 2 ) ) - (1 * 24 * 60 * 60) ) %>


date( strtotime( mysql_date )): <%= date( "Y-m-d", strtotime( date( "Y-m-d", $mysql_date ) )) %>

strtotime now: <%= strtotime("now") %>


date( strtotime( now )): <%= date( "Y-m-d", strtotime("now")) %>

date( strtotime( now - 1 )): <%= date( "Y-m-d", strtotime("now") - (1 * 24 * 60 * 60)) %>

<%= date("Y-m-d",strtotime($date_date) - (1 * 24 * 60 * 60))  %>

for clark: <%= strtolower( date( "M" )) %>

 </pre>
Return current item: FeedMeLinks, Social BookmarkingSince2002