Imagine this scenario - My javascript based web application, which allows users to buy an insurance policy, is accessed by users across the globe. In this application, accurate age calculation is of prime importance as the insurance premiums are calculated based on the age. The age should be calculated as follows -
Age = Current date (Pacific timezone) - User's Date of birth
I understand that I cannot use javascript's local Date() object to calculate user's age as this returns the local system time and in case the user's system's time is incorrect or the user is in a different timezone the age calculation won't be accurate.
I would like to know the best way to tackle this problem. Should I create a web service on my server that returns the current Pacific date?
Kindly share your inputs.
Thanks in advance!