The date and time field is used to input date and time data using a calendar and time selection panel.
It is suitable for managing specific dates and times as content, such as the event date, seminar application period, campaign duration, and the start and end times of reservation slots.

Please refer to the following documents for submissions using API and CSV.
Setting Item | Description |
|---|---|
Required Field | When enabled, input is required during submission. |
Description | This is the description displayed on the submission screen. |
Date Only | When enabled, time selection is disabled, and only the date can be selected and managed. |
Default Value | You can set the default value for submissions. |
"T00:00:00.000Z").Please refer to the documentation below for details.
The date field is returned as a string in ISO 8601 format (UTC), so on the frontend, you can convert it to a Date object as needed and format it into any desired timezone or format.
Below is an implementation example using Next.js.
export default async function Page({ params }) {
const { slug } = await params;
// Fetch data using the microCMS JavaScript SDK (https://github.com/microcmsio/microcms-js-sdk)
const data = await client.getListDetail({
endpoint: "blog",
contentId: slug,
});
// dateField is the field ID. Please replace it with the actual field ID.
const date = new Date(data.dateField);
// Format to Japan Standard Time (JST) and "YYYY年MM月DD日"
const formattedDate = new Intl.DateTimeFormat("ja-JP", {
dateStyle: "long",
timeZone: "Asia/Tokyo",
}).format(date);
return (
<main>
<time dateTime={data.dateField}>{formattedDate}</time>
</main>
);
}