I have a start_time and end time from a resource. I need to get the current time to check if this end time has passed. I was using moment for this..but the issue I'm facing is that the moment is picking time from my local computer which is few minutes slower than the actual time.
Is there a way to get the correct current time without taking the local server time.
Also I need to find the time difference between current and end time both in new york time zone. When using moment() it's giving utc time with moment().format() only I'm getting the correct value but it's a string this is in case of current time. For end time I did moment(end_time) which is giving the right result. If i use format it goes to a different time zone. How can I do a subtraction to find the time difference .