---
title: "rector/datetime-to-carbon set"
pagination: false
---

{/* Generated by scripts/gen-rule-docs.py. Edit mapping.toml, not this file. */}

Rector's `datetime-to-carbon` set: the Pun lint rules its Rector rules map to, and nothing else.

```toml
[lint]
sets = ["rector/datetime-to-carbon"]
```

A rule merged from several Rector rules runs only the rewrites of this set's Rector rules, unless a [preset](/docs/configuration/presets#lint-presets) also turns it on. Rector rules that are format rules in Pun run under `[format]` instead. Laravel, Pest, and PHPUnit rules also need their [extension](/docs/configuration/pun-toml#extensions).

## Rules (3)

| Rule | Rector rules | Status |
| --- | --- | --- |
| [`lint/style/prefer-carbon`](/docs/rules/lint/style/prefer-carbon) | `DateTimeInstanceToCarbonRector`, `DateTimeMethodCallToCarbonRector` | Ported |
| [`lint/style/prefer-carbon-date`](/docs/rules/lint/style/prefer-carbon-date) | `DateFuncCallToCarbonRector` | Ported |
| [`lint/style/prefer-carbon-timestamp`](/docs/rules/lint/style/prefer-carbon-timestamp) | `TimeFuncCallToCarbonRector` | Ported |
