I am using react-native-modal-datetime-picker library to get the time from the user. But I am getting time with complete date how should i get time from that. Following is my code to get time.
_showDateTimePicker = () => this.setState({ isDateTimePickerVisible: true });
_hideDateTimePicker = () => this.setState({ isDateTimePickerVisible: false });
_handleDatePicked = (time) => {
console.log('A time has been picked: ', time);
this._hideDateTimePicker();
};
<DateTimePicker
isVisible={this.state.isDateTimePickerVisible}
onConfirm={this._handleDatePicked}
onCancel={this._hideDateTimePicker}
mode='time'
/>
I am getting the timePicker coming on screen but after selecting a time it is showing a complete date with selected time but I want only time
The output I am getting is,
A time has been picked: Tue Feb 05 2019 12:25:00 GMT+0530 (India Standard Time)