0

I have two moment object with one difference in format of there fields, and that difference is the obstacle . how to convert those two objects of similar format ? screenshot of the console

the key "_i" is the difference the format of the 2nd object is working for me. So how to convert the 1st object exactly similar to 2nd object

prabeen90
  • 450
  • 3
  • 12

1 Answers1

0

Your second date is in UTC format.

To convert your first date to UTC format, use moment().utc() function of momentjs library.

Below is working example:

var yourDate = moment().utc();

console.log(yourDate);
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.1/moment.js"></script>
Vikasdeep Singh
  • 20,983
  • 15
  • 78
  • 104