0
<Datetime dateFormat={false} className="form-control" onChange={this.handleChange.bind(this)}/>

I am using react-datetime for time picker

 handleChange(newtime){
            this.setState({MTtime: moment(newtime).format("hh:mm:ss a")});
        }

enter image description here

UI Not Coming Properly

user9883888
  • 389
  • 1
  • 8
  • 17
  • The first thing I noticed is that the library `react-bootstrap-datetimepicker` is deprecated. You should be using `react-datetime` and that library has a `timeFormat` method that mimics `moment.js` http://momentjs.com/docs/#/displaying/format/ – zfrisch Jul 09 '18 at 15:54
  • Use moment().format('x') – NullPointer Jul 09 '18 at 15:57
  • I have updated the question with react-date time UI not coming good – user9883888 Jul 09 '18 at 16:29

1 Answers1

0

react-bootstrap-datetimepicker is deprecated, you should uninstall it and use react-datetime

To convert the timestamp to a date take a look at this answer

sanghin
  • 398
  • 3
  • 14