# Angular: NG02100: InvalidPipeArgument: 'Unable to convert "x" into a date' for pipe 'DatePipe'

**Code:** `NG02100` · **Category:** Angular · **Seen on:** Angular, TypeScript

The `date` pipe was given a value it cannot turn into a Date — an invalid string, a non-ISO format, `null` handled wrongly or a string locale format.

## Meaning

`DatePipe` accepts a `Date`, a number (ms), or an ISO 8601 string. Formats like `13/05/2024` or `2024-13-05` fail. Convert on input with `new Date(...)`, a date library, or fix the API to send ISO strings. `null`/`undefined` returns an empty string, but invalid text throws.

## Common causes

- Date string in a non-ISO format (`dd/MM/yyyy`)
- Invalid value ("N/A", empty string with whitespace)
- Epoch in seconds instead of milliseconds producing a wrong date
- Time zone or locale issues in string parsing
- Value is an object that is not a Date

## Quick fix

1. Convert to `Date` or ISO in the component/service
2. Validate or default invalid values before the pipe
3. Send ISO 8601 strings from the API

## Detailed fix by platform

### Angular

1. `{{ createdAt | date:'medium' }}` with `createdAt` as an ISO string or Date
2. Convert seconds: `new Date(seconds * 1000)`

## Code examples

### Normalise before the pipe

```typescript
const raw = '13/05/2024';                      // not ISO: DatePipe throws
const [d, m, y] = raw.split('/').map(Number);
this.created = new Date(y, m - 1, d);          // Date object works with | date
```

## How to diagnose

1. **Value** — Exact value passed to the pipe?
2. **Format** — ISO 8601, ms or Date?
3. **Source** — API or user input?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/angular/ng02100-invalidpipeargument-datepipe)
