React Native and the jumping datepicker

const date = new Date('1978-08-07');
const offset = -1 * date.getTimezoneOffset() * 60 * 1000;
const localDate = new Date(date.getTime() - offset);
// we could also use the more params constructor which uses the local timezone
new Date(1978, 7, 7);
moment.tz('1978-08-07', 'Europe/Berlin').toDate()
moment.tz('1978-08-07', 'Europe/Berlin').utcOffset() // 60

--

--

--

developer at finanzguru.de

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Florian Hirsch

Florian Hirsch

developer at finanzguru.de

More from Medium

Introduction to React Native Reanimated

Expo CLI vs React Native CLI

How to fetch 3 chain-endpoint using React Query & Axios

MVVM Pattern In React