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

c++ - CPP, 'X' button listener -

shared memory - gstreamer shmsrc and shmsink with h264 data -

.net - Bulk insert via Dapper is slower than inserting rows one-by-one -