Currently, I am sharpening my Next.js skills by building a blog. My current challenge involves formatting a static ISO time string (which represents the creation time of blog posts) to match the local timezone of the user.
<div className='post-time'>
Posted at {new Date(post.frontmatter.date).toLocaleString()}
</div>
Unfortunately, this approach is resulting in an error:
Unhandled Runtime Error
Error: Text content does not match server-rendered HTML.
Despite following the documentation's recommendation to turn it into a state, the error persists. I believe there is a simple solution that I am overlooking. Can you help me figure out how to make this work?