How to calculate time based on location in react native -


how can calculate time based on different location's time in react native app? example, user in new york , want app convert time user inserts , convert based on location's time (which given in lat/long) , send server store in db. time in advance.

since default date.now() give time based on phone's timezone, suggest using momentjs has feature utc time (more on docs).

the default use be:

const = moment(); 

and in order avoid timezones , utc time:

const = moment.utc(); 

Comments

Popular posts from this blog

qt - QML MouseArea onWheel event not working properly when inside QML Scrollview -

java - is not an enclosing class / new Intent Cannot Resolve Constructor -

python - Error importing VideoFileClip from moviepy : AttributeError: 'PermissionError' object has no attribute 'message' -