CODEforDREAM
CODEforDREAM

Reputation: 1093

Why date show on ios diffrent than show on android in react-native

I'm making a react-native app, but i don't understand how, but on android, the date feel like do not change by what i set.

So i have a function to show date, look like this

const showDate = dateFormat.toLocaleString("default", {
    month: "short",
    day: "2-digit",
  });

So weird that it will display so diffrent on android and ios

For android, it display like this, feel like this function do not effect android:

enter image description here

And here is when it show in ios

enter image description here

The different thing i noiticed is android use old time, like when i do not boot emulator, it freeze time, but i don't know what make time display so different on both devices

Please help, thank a lots

Upvotes: 1

Views: 1196

Answers (1)

P-A
P-A

Reputation: 419

Don’t worry it’s normal it’s just broken on android. Look at moment.js library it works fine on iOS and android.

  Moment(date).format('DD/MM/YYYY, hh:mm:ss')
  Output is 11/11/2019, 1:17:00

Upvotes: 2

Related Questions