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

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -