Skip to content

Converting a complex timestamp to normal time in angular

I have a time stamp like


I want to convert that into normal time like this (below) in the ts file


I am working in angular. Please help if you guys know. I have tried searching other stackoverflow questions but I couldn’t find the exact solution

Please help if you guys know


Use, Angular’s built-in DatePipe.

if you want to use it in html

{{ yourDate| date: 'shortTime'}}

or in component file:

const myDate = new DatePipe('en-US').transform(rawDate,'shortTime' );

rawDate is your complex timestamp.

to know more about formats available , head on to