title: See date on button click in react
body: <p>The below code not showing the expected output of current date and time</p>
  <pre><code>class Mydate extends React.Component{
    constructor(props){
      super(props);
      this.state={
        date:new Date(),
        showMessage: false
      }
      this.show=this.show.bind(this);
    }
    show(){
      this.setState({showMessage: true});
      return this.state.date;  
    }
    render(){
      return(
        &lt;div&gt;
          &lt;h2&gt;Hello World!!&lt;/h2&gt;
           {this.state.showMessage &amp;&amp; &lt;p&gt;{this.state.date}&lt;/p&gt;}
          &lt;button onClick={this.show}&gt;show Date&lt;/button&gt;
        &lt;/div&gt;
      );
    }
  }
      
  </code></pre>
  <p>why show() doesnt work here.Can you please help me to know where is the issue</p>