Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2002
    Posts
    183

    Need help with strtotime()

    Code:
    <?
    
    $caldate = $_REQUEST['eventid'];
    
    $timestamp = strtotime('$caldate');
    echo date('n/j/Y D', $timestamp);
    ?>
    Is returning 12/31/1969 for some reason when the $caldate is passed as 2006-08-24. Whats going down fellas.

  2. #2
    Join Date
    Nov 2003
    Posts
    691
    PHP Code:
    <?= date('n/j/Y D'strtotime($_REQUEST['eventid'])); ?>

  3. #3
    Join Date
    Mar 2006
    Posts
    984
    Hum, look at that - another 1969 bug issue.

  4. #4
    Join Date
    Nov 2003
    Posts
    691
    Actually the problem is expecting PHP parse a variable in single-quotes, which it doesn't.

  5. #5
    Join Date
    Jul 2003
    Location
    Kuwait
    Posts
    5,104
    Change

    $timestamp = strtotime('$caldate');

    To

    $timestamp = strtotime($caldate);

Posting Permissions

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