How to get the Current Date in ReactNative?
问题 I am building my first ReactNative iOS and Android app. I am an iOS coder with Swift and Obj-C. How do I fetch the current date using ReactNative. Shall I use Native Modules or is there an ReactNative API from which I can get this data ? 回答1: The JavaScript runtime in React Native has access to date information just like any other environment. As such, simply: new Date() ... will give you the current date. Here's the MDN on working with dates in JS. If you want a good JS library to make