---
title: "Timestamp"
description: "This article explains what the timestamp field is and how to configure it."
meta_title: "Timestamp"
category: "fields"
audience: developers
lastUpdated: "2025-11-06T01:07:50.000Z"
---

The timestamp field allows content writers to select a date and time.

The timestamp is saved in `YYYY-MM-DDTHH:MM:SS+0000` format, like <Code>{new Date().toISOString().replace(/\.\d{3}/, '').replace('Z', '+0000')}</Code>. The timestamp is always [UTC](https://en.wikipedia.org/wiki/Coordinated_Universal_Time) (`+0` offset).

Timestamp field values can be formatted and displayed like any JavaScript date using the `asDate()` helper from `@prismicio/client`.

**Next.js example:**

```tsx
import { asDate } from "@prismicio/client";

const timestamp = asDate(slice.primary.release_timestamp);

<span>{timestamp?.toLocaleDateString("en-US")}</span>;
```

**Nuxt example:**

```vue-html
<span>{{ $prismic.asDate(slice.primary.release_timestamp)?.toLocaleDateString("en-US") }}</span>
```

**SvelteKit example:**

```svelte
<script lang="ts">
  import { asDate } from "@prismicio/client";
</script>

<span
  >{asDate(slice.primary.release_timestamp)?.toLocaleDateString("en-US")}</span
>
```

> Unlike the [date](https://prismic.io/docs/fields/date.md) field, the timestamp field includes a time.

# Add a timestamp field to a content model

1. **Open Slice Machine**

   In your Prismic project, start Slice Machine to begin editing content models.

   ```sh
   npx start-slicemachine --open
   ```

2. **Add a timestamp field**

   In Slice Machine, navigate to the slice, page type, or custom type you want to modify. Add a **timestamp** field.

   The **label** determines the label shown to content writers in the [Page Builder](https://prismic.io/docs/guides/page-builder.md). Use an easily understood name.

   The **API ID** determines the property name in the Content API. Use a short, snake-cased name.

# Use timestamp fields

Timestamp fields can be used anywhere a timestamp is needed. It is often helpful to first convert the timestamp to a JavaScript `Date` object using `asDate` from `@prismicio/client`.

**Next.js example:**

```tsx
import { asDate } from "@prismicio/client";

function Slice() {
  const timestamp = asDate(slice.primary.release_timestamp);

  return <span>{timestamp?.toLocaleDateString("en-US")}</span>;
}
```

**Nuxt example:**

```vue
<script setup lang="ts">
const { asDate } = usePrismic();

const timestamp = computed(() => asDate(slice.primary.release_timestamp));
</script>

<template>
  <span>{{ timestamp?.toLocaleDateString("en-US") }}</span>
</template>
```

**SvelteKit example:**

```svelte
<script lang="ts">
  import { asDate } from "@prismicio/client";

  let timestamp = $derived(asDate(slice.primary.release_timestamp));
</script>

<span>{timestamp?.toLocaleDateString("en-US")}</span>
```

# Check if a timestamp field has a value

Use `isFilled.timestamp()` from [`@prismicio/client`](https://prismic.io/docs/technical-reference/prismicio-client/v7.md) to check if a timestamp field has a value.

```ts
import { isFilled } from "@prismicio/client";

if (isFilled.timestamp(slice.primary.my_timestamp_field)) {
  // Do something if `my_timestamp_field` has a value.
}
```

[Learn more about `isFilled`](https://prismic.io/docs/technical-reference/prismicio-client/v7.md#isfilled)

# API response

Here is what a timestamp field looks like from the Content API:

```json
{
  "example_timestamp": "2030-01-31:05:00:00+0000"
}
```
