Skip to content

Commit

Permalink
Update MovieDetail.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
rhose1234 authored Sep 18, 2023
1 parent 2bb46a0 commit 752f7d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/MovieDetail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ export default function MovieDetail() {
const [movie, setMovie] = useState(null);

const formatDateToUTCString = (dateString) => {
const options = { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' };
const options = { weekday: 'short', day: '2-digit', month: 'short', year: 'numeric', hour: '2-digit', minute: '2-digit', second: '2-digit', timeZoneName: 'short' };
const dateInLocalTime = new Date(dateString);
const dateInUTC = new Date(dateInLocalTime.getTime() + dateInLocalTime.getTimezoneOffset() * 60000);
return dateInUTC.toLocaleDateString(undefined, options);
return dateInUTC.toLocaleDateString('en-US', options);
};

useEffect(() => {
Expand Down

0 comments on commit 752f7d3

Please sign in to comment.