2

I am the problem in defining the output of "date" . I would like that the past value for the variable is dd / mm / yyyy. The problem is who is going 2016-05-11T19 : 23: 34.399Z "

2
  • plnkr.co/edit/LRnkwtiIFearwbiDB5Qm?p=preview Commented May 11, 2016 at 20:11
  • 2
    Do you want to display the date with the mentioned format? Then you could use {{dt | date: 'dd / MM / yyyy'}}. MM in uppercase!! Commented May 11, 2016 at 20:15

2 Answers 2

2

Just use like this

{{dt | date:'dd/MM/yyyy' }}
Sign up to request clarification or add additional context in comments.

2 Comments

Should be 'dd/MM/yyyy' as pointed out by @AWolf because mm = minutes
I want the variable "dt" is already in the standard dd/MM/yyyy. It's because I 'm going to pass this variable as a parameter , then it must be in this format
2

Add a date filter and required format.

 {{dt | date: 'dd/MM/yyyy'}}

http://plnkr.co/edit/DDDepd8uwpzdBlGgxpuk?p=preview

@Yehudi Mekhael, if you want dt to be in that format and pass as parameter then you can do something.

var dt = $filter('date')(dt, 'MMM dd yyyy');

But now dt is not a date object, it's a string.

3 Comments

Should be 'dd / MM / yyyy' as pointed out by @AWolf because mm = minutes
@mhodges Done! Thanks
I want the variable "dt" is already in the standard dd/MM/yyyy. It's because I 'm going to pass this variable as a parameter , then it must be in this format

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.