title: moment.js: Deprecation warning: value provided is not in a recognized RFC2822 or ISO format
body: <p>I am getting date as input from an external source and it is a string,</p>
  
  <pre><code>const a = '08-01-2019';
  </code></pre>
  
  <p>And required format for me is 'MM-DD-YYYY',</p>
  
  <pre><code>const outputDateFormat = 'MM-DD-YYYY';
  </code></pre>
  
  <p>And I am using moment.js and doing below manipulations on that date like adding a year and decreasing a day,</p>
  
  <pre><code>//adding a year 
  
  const a = moment(a).add(1, 'years').add(-1, 'days').format(outputDateFormat);
  </code></pre>
  
  <p>for the above line, I am getting ,</p>
  
  <pre><code>Deprecation warning: value provided is not in a recognized RFC2822 or ISO format.
  moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release.
  </code></pre>
  
  <p>I mean, Converting to my output required format using moment is giving the deprecated warning.</p>
  
  <pre><code>const finalDate = moment(a).format(outputDateFormat); - Resulting depricated warning
  </code></pre>
  
  <p>So, I have tried using new Date() as below to avoid warnings.</p>
  
  <pre><code>//adding a year - approach #1
  
      const a = moment(new Date(a)).add(1, 'years').add(-1, 'days').format(outputDateFormat);
  </code></pre>
  
  <p>This is not returning any error but I am not considering this approach of new Date() as my code should work across timezones and locales. And if we use new Date() code might not work properly across timezones and locales? can anyone suggest?</p>
  
  <p>And so, I have followed this approach # 2,</p>
  
  <pre><code>//adding a year - approach #2
  
      const a = moment('2019-01-08').add(1, 'years').add(-1, 'days').format(outputDateFormat);
  </code></pre>
  
  <p>Where I am giving date format in the form 'YYYY-MM-DD' instead of my input date format 'MM-DD-YYYY'. </p>
  
  <p>This is also, not returning any warning and code is working fine. Will this work across timezones and locales?</p>
  
  <p>Can anyone suggest me to use approach #1 or #2 to make my code work across timezones/locales without any errors/momentjs warnings?</p>
  
  <p>Do I need to use <code>moment.utc</code> here to make code work across timezones? I think UTC is not required, As I am not having any time-related validations.</p>
  
  <p>I mean moment.utc() is not required I guess as there is no time component for me, please suggest.</p>
  
  <pre><code>moment.utc('2019-01-08').add(1, 'years').add(-1, 'days').format(outputDateFormat)
  </code></pre>
  
  <p>Or else can anyone suggest a better approach than this to make code work across timezones and locales without any issues?</p>