Results 1 to 12 of 12

Thread: [Resolved] Date Comparison Problems

Threaded View

  1. #1

    Thread Starter
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256

    [Resolved] Date Comparison Problems

    I'm having a problem comparing dates. I've tried the following two:

    Code:
    //tried this:
    if ($comic['released'] <= date('Y-m-d')) {
        $date = "Now!";
    } else {
        $date = date('F jS, Y', strtotime($comic['release'])) . ".";
    }
    
    //and this:
    if (date('Y-m-d', strtotime($comic['released'])) <= date('Y-m-d')) {
        $date = "Now!";
    } else {
        $date = date('F jS, Y', strtotime($comic['release'])) . ".";
    }
    $comic['released'] is a date format in MySQL.

    No matter what, it always prints "Now!"

    Where am I going wrong?
    Last edited by The Hobo; Jan 30th, 2003 at 12:58 PM.
    My evil laugh has a squeak in it.

    kristopherwilson.com

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