I want to get the time with react-native-date-picker
. So I set the mode as time
. But this gives in this format, Here time is not correct too.
2023-01-25T16:50:53.467Z
This is my code,
<DatePicker
mode="time"
date={date}
modal
open={pickupTimeModal1}
onConfirm={time => console.log(time)}
onCancel={() => {
setPickupTimeModal1(false);
}}
/>
2
Answers
I think this library gives you an entire date string.
You can convert the date to a format that you like:
for better conversion, you can also use date-fns