1

I am new to AngularJS and I am trying to publish timestamp (1395227726) as a normal date.

When I use the following template:

{{ item.dt }} : {{ item.dt | date:'medium' }}

it shows me

1395226874 : Jan 17, 1970 7:33:46 AM

but should should be: Wed, 19 Mar 2014 11:15:26 GMT

Could you tell me why it is so and how to publish a date?

1 Answer 1

1
{{ item.dt * 1000 | date:'medium' }}

Timestamps need to be in milliseconds.

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.