Difference between two dates
Input String: calculateDays(“01-01-2014″,”12-12-2014”)
Date Format: MM-DD-YYYY
function calculateDays(datetime1, datetime2) {
var oneDay = 1000 * 60 * 60 * 24; // The number of milliseconds in a day
//Convert the datetime1 and datetime2 to Date object and get Time in milliseconds
var dt1 = new Date(datetime1).getTime();
var dt2 = new Date(datetime2).getTime();
// Calculate the difference in milliseconds
var diff = Math.abs(dt1- dt2); // Difference of Days
return Math.round(diff / oneDay);
}
Discover more from Arun Potti's Power Platform blog
Subscribe to get the latest posts to your email.
Keep this going please, great job!
Thank you
Thanks for the great post!
Thank you Ola Abke 🙂
Great info!
Top notch blog post.Thanx just for penning this useful article in addition to enlightening us all with the feelings.I’m hoping you are going to proceed this great work at a later date as well.
Nice post. I learn something totally new and challenging on sites I stumbleupon every day.
It’s always exciting to read content from other writers and use something from other websites.
“Great Blogpost! Hi there! This is my first comment here so I just wanted to give a quick shout out_ and tell you I genuinely enjoy reading through your posts. Can you recommend any other blogs/websites/forums that deal with the same topics?”
“Great Blogpost! Hi there! This is my first comment here so I just wanted to give a quick shout out_ and tell you I genuinely enjoy reading through your posts. Can you recommend any other blogs/websites/forums that deal with the same topics?”