0

I have this source of date :

TimeR ="2017-02-17 19:50:11 UTC";

In the Html file i used this code

<span class="text-lg">{{TimeR | date: 'hh:mm'}}</span>

It works good, but i just got the time without AM/PM, how can i fix it or how can get the date like this (for example 10:00 pm - 22:00)

2 Answers 2

2

Add mediumTime to the pipe this should add the AM PM to your output. For future reference use this

{{ TimeR | date:'mediumTime' }}

Hope that helps

Sign up to request clarification or add additional context in comments.

Comments

1

I have been working with dates and times recently, and I would suggest you to look into MomentJS. You can easily create your own pipe with something as follows:

return moment("2017-02-17 19:50:11 UTC", "YYYY-MM-DD H:m:s z").format("H:m");

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.