Formatting dates
Use the formatDate
function in /src/lib/utils.ts
to format dates. The default locale is set to en-US
— you can change this in /src/siteConfig.ts
.
Adding timestamps
For a more detailed timestamp, you use ISO 8601 format. This will improve how your RSS feed is displayed in readers, and will also ensure that posts published on the same day are sorted correctly.
Displaying the timestamp
-
Update the
formatDate
function in/src/lib/utils.ts
. -
Update
src/types.ts
to include the newtimezone
property. -
Add the
timezone
property to yoursiteConfig.ts
file. -
Display the timestamp on your page.