0

How to make Date without timsezone converted inside React Native app?

new Date('2019-11-15T00:00:00+00:00')

It give 2019-11-14T00:00:00.000Z?

How do I make sure it is 15th?

Alvin
  • 7,787
  • 23
  • 77
  • 164

1 Answers1

1

Date:

const date = new Date('2019-11-15T00:00:00+00:00');
const date2 = new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes());

String:

const date = new Date('2019-11-15T00:00:00+00:00');
date.toUTCString();
dmitri7
  • 193
  • 5