0

I have a string with a full date like this: "2016/03/05 13:47:18 +0000".

I want covert it to "2016-03-05" or "05-March-2016" on Angular scope. I also have integer time duration = 421471 which I want to convert to a time format like "23:45" or "1 hour , 50 minute".

{{sound.created_at | date}} 

{{sound.duration}} 

How can I do that?

5
  • 3
    Did you look at moment? momentjs.com This lib does all the job anyome would need to do in JS and integrates well in AngularJs and Angular4 Commented Dec 22, 2017 at 16:25
  • Is there a question? Commented Dec 22, 2017 at 16:27
  • i need for angular @bsoulier Commented Dec 22, 2017 at 16:30
  • github.com/urish/angular-moment as I said Commented Dec 22, 2017 at 16:32
  • Added proper answer to your question from my comment so that you can mark it as answer :) Commented Dec 22, 2017 at 17:10

1 Answer 1

1

To solve your issue please use momentjs as very famous lib to deal everything about date in js.

To make it work well with Angularjs/4, please have a look here.

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

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.