react native system date code example
Example 1: react native get current time
var date = new Date().getDate();
var month = new Date().getMonth() + 1;
var year = new Date().getFullYear();
var hours = new Date().getHours();
var min = new Date().getMinutes();
var sec = new Date().getSeconds();
Example 2: react native system date
import React, { Component } from 'react';import { render } from 'react-dom'; class App extends Component { constructor() { this.state = { currentDateTime: Date().toLocaleString() } } render() { return ( <div> <p> { this.state.currentDateTime } </p> </div> ); }} render(<App />, document.getElementById('root'));