0

I want to display date and time in html like this:

19 Jan 2023. at 14:15

I am using this DatePipe:

{{order.updatedAt | date: 'dd MMM, y. h:mm a'}}

When I place "at" like this: {{order.updatedAt | date: 'dd MMM, y. at h:mm a'}}, I am given this result:

enter image description here

Can you help me guys how to solve this problem? In documentation, I don't find any DatePipe which suits me.

  • Does this answer your question? [Include text in Angular 2+ Date Pipe format](https://stackoverflow.com/questions/45843532/include-text-in-angular-2-date-pipe-format) – tilo Jan 19 '23 at 13:11

2 Answers2

2

You can add your own text (which is not part of the format) by using something like

{{order.updatedAt | date: "dd MMM, y. 'at' h:mm a"}}
tilo
  • 14,009
  • 6
  • 68
  • 85
1

I think you need to write two pipe line code.

{{order.updatedAt | date: 'dd MMM, y.'}} at {{order.updatedAt | date: 'h:mm a'}}
Kapil Thakkar
  • 840
  • 10
  • 17