React Native app is displaying the time 8 hours behind only for Android but displays the time correctly for iOS

Viewed 194

I'm trying to pass in a date object into a component and format the date and time using Date.toLocaleString(). The problem is that on the Android side, the time is always 8 hours behind the time that's passed into it. This is not an issue on the iOS side.

date and time before toLocaleString: 2022-02-03T09:24:41.230Z date and time after toLocaleString: Thu Feb 3 01:24:41 2022

0 Answers
Related