# Format AM and PM in times correctly (EK00044)

import { Aside, Badge } from '@astrojs/starlight/components';

Writing 12-hour times as a numeral, a space, then capital `AM` or `PM` without periods keeps schedules predictable and easy to scan. EkLine flags times where `AM` or `PM` is lowercase, includes periods, is missing the leading space, or attaches to the number (rule EK00044).

## Why does consistent time formatting matter in documentation?

Inconsistent time formats like `2pm`, `2 p.m.`, and `2PM` across a document look careless and slow a reader who scans for a schedule. A single format — `2 PM` — is predictable and reads cleanly. Consistent times also copy-paste into calendars without cleanup.

## What EkLine flags

EK00044 flags a 12-hour time where AM or PM is lowercase, has periods, lacks the leading space, or attaches to the number.

- ❌ **Incorrect:** The build runs at 2pm.
- ✅ **Correct:** The build runs at 2 PM.
- ❌ **Incorrect:** The build runs at 2 p.m.
- ✅ **Correct:** The build runs at 2 PM.
- ❌ **Incorrect:** The build runs at 2PM.
- ✅ **Correct:** The build runs at 2 PM.

## How to fix

Write the time as a numeral, a space, then capital `AM` or `PM` without periods — for example, `2 PM`.

## FAQ

### How do you write AM and PM correctly?

Write a numeral, a space, then capital `AM` or `PM` without periods — for example, `2 PM`. Avoid forms like `2pm`, `2 p.m.`, or `2PM`.

### Should AM and PM be uppercase?

Yes. Use capital `AM` or `PM` without periods, and keep a space between the number and the abbreviation.

## Rule details

| Property | Value |
|----------|-------|
| Rule ID | `EK00044` |
| Category | Sentences and phrases |
| Default severity | <Badge text="Error" variant="danger" /> |
| Enabled by default | Yes |

## Ignore this rule

To keep a flagged time on one line, add an inline comment with a reason:

```markdown
<!-- ekline-ignore-next-line EK00044 -- matches the vendor's log format -->
The job logged an error at 2pm.
```

To disable the rule across your project, add it to the `ignore` list in your [configuration file](/reviewer/configuration/ignoring-rules/#ignore).

## Related rules

- [EK00055](/reviewer/rules/ek00055/) — Use numerals for time measurements
- [EK00051](/reviewer/rules/ek00051/) — Use American-style number formatting