Schema markup for datePublished and dateModified

Hi,

Is there a way to get the following?:

      "datePublished": "2024-01-05T08:00:00+08:00",
      "dateModified": "2024-02-05T09:20:00+08:00",

My frontmatter:

date: 2024-05-09T10:54:00+02:00
lastmod: 2024-05-10T16:35:00+02:00

My schema file:

datePublished: {{ .Param date }},
dateModified: {{ .Param lastmod }}

Output:

datePublished: 2024-05-17 11:12:00 \u002b0200 CEST,
dateModified: 2024-05-17 11:12:00 \u002b0200 CEST

How can I set it that Hugo gives the exact same output as I put in the frontmatter?

Like this:

      "datePublished": "2024-01-05T08:00:00+08:00",
      "dateModified": "2024-02-05T09:20:00+08:00",

Have a look at Hugo’s embedded schema template. There’s a link to it from here:
https://gohugo.io/templates/embedded/#schema