---
title: Last Modified Time
description: Output the last modified time of a document
---

## Usage

You can add the plugin from the config file.

<Callout type="warning" title="Git is used by default">
  Please ensure you have Git installed on your machine, and **the repository is not shallow
  cloned**, as it relies on your local Git history.
</Callout>

```ts title="source.config.ts"
import { defineConfig } from 'fumadocs-mdx/config';
import lastModified from 'fumadocs-mdx/plugins/last-modified';

export default defineConfig({
  // [!code ++]
  plugins: [lastModified()],
});
```

### Access the Property

After doing this, a `lastModified` property will be exported for each document (as `Date`).

```ts
import { source } from '@/lib/source';

const page = source.getPage(['...']);

console.log(page.data.lastModified);
// or with lazy loading
const { lastModified } = await page.data.load();
console.log(lastModified);
```

You can display it from UI like [`<DocsPage />`](/docs/ui/layouts/page#last-updated-time)
