CopyPastor

Detecting plagiarism made easy.

Score: 0.9229840365036455; Reported for: String similarity Open both answers

Possible Plagiarism

Reposted on 2022-11-09
by Kaushikkumar Parmar

Original Post

Original - Posted on 2021-09-13
by Kaushikkumar Parmar



            
Present in both answers; Present only in the new answer; Present only in the old answer;

You just need to use the date.diff() method in moment.js
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
const now = moment.utc(); var end = moment("2022-11-08"); var hours = now.diff(end, "hours"); console.log(hours)
<!-- language: lang-html -->
<script src="https://momentjs.com/downloads/moment.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<!-- end snippet -->

You just need to use the date.diff() method in moment.js
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
const now = moment.utc(); var end = moment("2021-09-13"); var days = now.diff(end, "days"); console.log(days)
<!-- language: lang-html -->
<script src="https://momentjs.com/downloads/moment.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<!-- end snippet -->


        
Present in both answers; Present only in the new answer; Present only in the old answer;