Issue
Here's my code:
var get_time = new Date(my_time.replace(' ','T')).getTime();
The values are different for Android & iOS.
I think there is some interference of timezones
Solution
I am not sure if it is the best way, You can convert the date to utc and set the time by adding the timezone offset
Try the following
get_time= new Date(new Date(get_time.replace(' ','T')+'Z').getTime()).setMinutes(new Date(new Date(get_time.replace(' ','T')+'Z').getTime()).getMinutes() + new Date(new Date(get_time.replace(' ','T')+'Z').getTime()).getTimezoneOffset());
It will provide the correct time according to your local time.
Answered By - Samaludheen
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.