title: using a php unix timestamp with moment.js
body: <p>Can't seem to get unix timestamps working with moment.js...</p>
  
  <p>date_create is equal to my php unix timestamp in this case and I want to use that as the startDate, minDate, and a few other places... I am not getting an error, but it is displaying as 'December 31, 1969 @ 7:00 pm' which is obviously not correct.</p>
  
  <p>What am I doing wrong here?  The goal is to have the correct date/time shown as computers time from the utc timestamp given.</p>
  
  <p>For instance 1401079499 is 05 / 26 / 14 @ 4:44:59am UTC, but this would show as May 26, ‎2014‎ ‎12‎:‎44‎:‎59‎ am ‎on my own computer being gmt-4</p>
  
  <pre><code>    var date_create = $('#dashboard-report-range #date-display').html(); //equals 1401079499
  
      //date range stuff
      $('#dashboard-report-range').daterangepicker({
          opens: 'left',
          startDate: moment.unix(date_create).startOf('day'),
          endDate: moment().endOf('day'),
          minDate: moment.unix(date_create).startOf('day'),
          maxDate: moment().endOf('day'),
          showDropdowns: false,
          showWeekNumbers: true,
          timePicker: true,
          timePickerIncrement: 1,
          timePicker12Hour: true,
          ranges: {
              'All': [moment.unix(date_create).startOf('day'), moment().endOf('day')],
              'Today': [moment().startOf('day'), moment().endOf('day')],
              'Yesterday': [moment().subtract('days', 1).startOf('day'), moment().subtract('days', 1).endOf('day')],
              'Last 7 Days': [moment().subtract('days', 6).startOf('day'), moment().endOf('day')],
              'Last 30 Days': [moment().subtract('days', 29).startOf('day'), moment().endOf('day')],
              'This Month': [moment().startOf('month'), moment().endOf('month')],
              'Last Month': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')]
          },
          buttonClasses: ['btn'],
          applyClass: 'btn-sm btn-success',
          cancelClass: 'btn-sm btn-default',
          format: 'MM/DD/YYYY',
          //format: 'MM-DD-YY',
          separator: ' to ',
          locale: {
              applyLabel: 'Apply',
              fromLabel: 'From',
              toLabel: 'To',
              customRangeLabel: 'Custom Range',
              daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
              monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
              firstDay: 1
          }
      },
      function (start, end) {
          $('#dashboard-report-range #date-display').html('&lt;span class="ddate_start"&gt;' + start.format('MMMM D, YYYY [@] h:mm a') + '&lt;/span&gt; &amp;nbsp;&lt;i class="fa fa-arrows-h"&gt;&lt;/i&gt;&amp;nbsp; &lt;span class="ddate_end"&gt;' + end.format('MMMM D, YYYY [@] h:mm a') + '&lt;/span&gt;');
          $('#dashboard-report-range #date-start').html( start.unix() );
          $('#dashboard-report-range #date-end').html( end.unix() );
          dt.draw();
      }
      );
  
      $('#dashboard-report-range #date-display').html('&lt;span class="ddate_start"&gt;' + moment.unix(date_create).startOf('day').format('MMMM D, YYYY [@] h:mm a') + '&lt;/span&gt; &amp;nbsp;&lt;i class="fa fa-arrows-h"&gt;&lt;/i&gt;&amp;nbsp; &lt;span class="ddate_end"&gt;' + moment().endOf('day').format('MMMM D, YYYY [@] h:mm a') + '&lt;/span&gt;');
      $('#dashboard-report-range').show();
  
  };
  </code></pre>
  
  <p><strong>EDIT - solution :</strong></p>
  
  <p>I had forgotten to change the id I grab the unix timestamp from... <code>$('#dashboard-report-range #date-create').html();</code>  With that change everything works as it should.</p>