title: jQuery UI datepicker: Displaying 1969 although I use strtotime
body: <p>I have PHP+JQUERY room reservation application. I'm using the datepicker widget for picking date and I encounter a problem. I try to convert the selected date (in dd/mm/yyyy format) to YYYY-mm-dd format in order to INSERT it to my database. When I pick the first dates, it converts well but when I pick other dates, I see the date 1969-12-31. Here is my JQUERY code:</p>
  
  <pre><code>    $(function() {
      $( "#datepicker" ).datepicker({ 
          showOn: "button",
          buttonImage: "images/calendar.gif",
          buttonImageOnly: true,          
          minDate: 0, 
          maxDate: "+3W", 
          dateFormat: "dd/mm/yy",
          beforeShowDay: function (date) {
          var day = date.getDay();
          return [(day == 0 || day == 1 || day == 2 || day == 3 || day == 4), ''];
          },
          onSelect: function(dateText) {
              $("#registration").load("room.php #registration", {selectedDate: dateText}, function() { 
                  $( "input:submit, a, button", ".registration" ).button();
                  $( "a", ".registration" ).click(function() { return false; });
              });
  
          }
  
      });
      });  
  </code></pre>
  
  <p>And then i echo the result for testing:</p>
  
  <pre><code>    &lt;?php if(isset($_POST['selectedDate']))
             { 
                $selectedDate=$_POST['selectedDate']; 
                echo date('Y-m-d',strtotime((string)$selectedDate)); 
             } 
      ?&gt;
  </code></pre>
  
  <p>Here is an image in my app: <a href="https://i.stack.imgur.com/qOVQp.jpg" rel="nofollow noreferrer">http://oi43.tinypic.com/29tv2c.jpg</a></p>
  
  <p><a href="https://i.stack.imgur.com/qOVQp.jpg" rel="nofollow noreferrer">1</a>: 
  <img src="https://i.stack.imgur.com/qOVQp.jpg" alt="enter image description here"></p>