Results 1 to 2 of 2

Thread: [Resolved] DateDiff problem

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2004
    Posts
    121

    Resolved [Resolved] DateDiff problem

    Hello all. I found the following code which will display the number of days between two dates. The problem is if I take out the "SEP" and replace it with say 9 or 09 it doesn't work.
    How would I rewrite this so that I can use all numeric values.
    All the dates in my database use yyyy-mm-dd format if that helps.

    Code:
    $today=date("d-m-Y");
    $date1=strtotime( "1-SEP-2005");
    
    $date2=strtotime($today);
    
    	echo "Difference: ".(($date2-$date1)/86400);
    Many thanks.
    Last edited by solitario; Sep 21st, 2005 at 11:09 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width