title: How to resolve RangeError: Invalid time value
body: <p>Making use of React, I have set up a DatePicker component using moment and react-datepicker library and am passing it an initial date value calculated using today's date in the MM-DD-YYYY format.</p>
  
  <p>When I try to load I get this error line : </p>
  
  <blockquote>
    <p>throw new RangeError('Invalid time value');
       Convert the date in system timezone to the same date in UTC+00:00 timezone.This ensures that when UTC functions will be implemented, locales will be compatible with them.`</p>
  </blockquote>
  
  <p>DatePicker component:</p>
  
  <pre><code>class DatePicker extends Component {
    render() {
      return (
        // &lt;input type="date" 
        //   className={this.props.className + " myInput"} 
        //   placeholder={this.props.placeholder} 
        //   onChange={this.props.onChange} 
        //   value={this.props.value}
        // /&gt;
          &lt;DatePicker2
            dateFormat="DD MMM YYYY"
            className={this.props.className + " myInput"} 
            selected={moment(this.props.value)}
            onChange={this.props.onChange} 
            readOnly={true}
          /&gt;
      );
    }
  }
  
  export default DatePicker;
  </code></pre>
  
  <p>My question is: how do I Convert the date in system timezone to the same date in UTC+00:00 timezone (assuming that's the solution, but if not, how do I resolve this?</p>