I'm currently getting the time in my client using Angular 11 (TypeScript).
I have noticed that actually, each user(using my website) can have a different hour , according to his\her location.
I'm using the follwoing code to get the current time:
let todaysDate = new Date().getTime();
If I'll open the website in Israel I'll get the local time, but opening the website in Australia will provide a different time.
I have a logic that rests on time comparison.
Do I have an option to get the specific area time(Israel for instance) for all users beside getting the time from server? I want to keep this logic only in my client side.
Convert date to a specific timezone using below code
Refer Answer