Question: I have to convert my server data in string format as `13:47` to `01:47PM` but am trying with `{{time | date:"hh:MM"}}` and `{{task.time | date: 'shortTime'}}` but it showing an datepipe error and arugument error

*Runtime Error*

> 
> InvalidPipeArgument: '13:17' for pipe 'DatePipe'
> 
> 
>

Answer: 
From the documentation

> 
> <https://angular.io/api/common/DatePipe>
> 
> 
> expression is a date object or a number (milliseconds since UTC epoch) or an ISO string (<https://www.w3.org/TR/NOTE-datetime>).
> 
> 
> 

Angular Default DatePipe only has support for Date Objects or ISOStrings(). If you want to convert either into format '01:47PM', the format would be 'hh:mmA'
Here you need to use [**momentjs**](https://momentjs.com/docs/#/use-it/typescript/).

*1st Step:*

[**Reference:**](https://momentjs.com/docs/#/use-it/typescript/)

```
npm install moment

```

*ts*

```
import * as moment from 'moment';

```

*2nd Step:*

[**Reference:**](http://momentjs.com/docs/#/parsing/string-format/)

```
moment({ // Options here }).format('hh:mmA')

```