Hell,
I am trying to work with dates in React Native and I am struggling to understand why it adds another 2 hours when I call date.getHours().
This is what I receive from backend: 2018-06-03T11:00:00
.
This is a final locale date with hours that I should present to the user, so I expect when I call new Date('2018-06-03T11:00:00').getHours()
it should return 11
. And it works well in a browser without a problem, but when I use it in my React Native project on both platforms (iOS and Android) it returns for me 13
instead of 11
.
What am I missing? How to explicitly tell Date
that it should not convert it again to date with different timezone?