I am trying to convert date and time to simpler format, in particular i'd like to understand how can i convert this: 2020-12-20T09:30:00.485Z (UTC) to this: 2020-12-20 10:30 (UTC+1)
in the following React Component ({day.date}):
import React, { useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { detailsDate } from '../actions/dateAction';
import LoadingBox from '../components/LoadingBox';
import MessageBox from '../components/MessageBox';
function BookingConfirmationScreen(props) {
const dayId = props.match.params.id;
const dateDetails = useSelector((state) => state.dateDetails);
const { day, loading, error } = dateDetails;
const dispatch = useDispatch();
useEffect(() => {
dispatch(detailsDate(dayId));
// eslint-disable-next-line no-console
return () => {};
}, [dispatch, dayId]);
return (
<div>
{loading ? (
<LoadingBox />
) : error ? (
<MessageBox variant="error">{error}</MessageBox>
) : (
<h1> Booking {day.date}</h1>
)}
</div>
)
}
export default BookingConfirmationScreen;