This question already has an answer here:
- Moment js date time comparison 3 answers
I am using moment.js in my application, I pass my date in a particular format to moment.js and it compares it with the system time and give me the pretty time format, like this:
moment(time, "YYYY-MM-DD HH:mm:ss.SSSSSS").fromNow();
Here the time is given by me as a timestamp in the specified format.
My problem is that fromNow() function takes the system date and not the server date. So, if a user uses his phone with 5 min delay time in his system he will get 4 min ago as the latest updated cards.
I want to compare "time" that I pass with the server time, that also will be passed by me.