I have static timestamp from backend and I want to refresh the pipe every 1 second to get date from now and this my pipe
import { Pipe, PipeTransform } from '@angular/core';
import moment from 'moment';
@Pipe({
name: 'dateFormat'
})
export class DateFormatPipe implements PipeTransform {
transform(date: string): string {
return moment.utc(date, 'X').local().format('DD-MM-YYYY h:mm:ss a');
}
}
in this case it just convert time stamp to this format , I want to keep date updated how can I do this ?