timezone fix

This commit is contained in:
2022-12-10 20:54:04 -05:00
parent 04966204fd
commit a2d9f2c029
3 changed files with 23 additions and 5 deletions
+4 -2
View File
@@ -1,5 +1,5 @@
---
import { format } from "date-fns";
import { formatInTimeZone } from "date-fns-tz";
interface Props {
title: String;
@@ -11,5 +11,7 @@ const { title, date } = Astro.props;
<div class="blog-header">
<h4>{title}</h4>
<h5>{`🗓️ ${format(new Date(date), "MMM do, y")}`}</h5>
<h5>
{`🗓️ ${formatInTimeZone(new Date(date), "America/New_York", "MMM do, y")}`}
</h5>
</div>