title: How do I properly get the date and time?
body: <p>I am new to react and trying to get the actual date and time but I can't figure out how to do so :( </p>
  
  <p>Could someone help me please !</p>
  
  <p>I try to get the date in the initial state and actualise it every second. When I run it, I get a white screen.</p>
  
  <pre><code>import React from 'react';
  import './Menubar.css';
  import Time from 'react-time';
  
  const Menubar = React.createClass({
  getInitialState() {
      return {
          now: new Date().now(),
      };
  },
  
  getRealTime: function() {
      this.setState(
          {
              now: new Date().now(),
          })
  },
  
  /**
   * Render the Menubar component
   * @return {Component} the App Component rendered
   */
  render() {
      setInterval(this.getRealTime(), 1000);
      return (
          &lt;div className="Menubar"&gt;
              &lt;ul className="Menubar-menu"&gt;
                  &lt;div className=""&gt;
                      &lt;li className="Menubar-name"&gt;login name&lt;/li&gt;
                      &lt;li className="Menubar-date"&gt;&lt;Time value={this.state.now} format="DD/MM/YYYY" /&gt;&lt;/li&gt;
                      &lt;li className="Menubar-time"&gt;&lt;Time value={this.state.now} format="HH:mm:ss" /&gt;&lt;/li&gt;
                  &lt;/div&gt;
              &lt;/ul&gt;
          &lt;/div&gt;
      );
  }
  });
  
  export default Menubar;
  </code></pre>