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

## Usage

This feature is not enabled by default, you can enable this from config file. Notice that it only supports Git as version control.
When using `git`, please ensure you have Git installed on your local machine and the repository is not shallow cloned, as it relies on your local Git history.

```js
import { defineConfig } from 'fumadocs-mdx/config';

export default defineConfig({
  lastModifiedTime: 'git', // [!code highlight]
});
```

### Access the Property

After doing this, a `lastModified` number will be exported for each document, you can convert it to a JavaScript Date object.

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

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

console.log(new Date(page.data.lastModified));
```
