I am using below code to convert timestamp to date
import { DatePipe } from '@angular/common';
constructor(private pipe: DatePipe) {
}
dateConverter(timestampDate: any) {
if (timestampDate.toString().indexOf('.') > 0) {
return this.pipe.transform(new Date(timestampDate* 1000), 'dd-MMM-y');
} else {
timestampDate= timestampDate.toString() + '.0000';
return this.pipe.transform(new Date(timestampDate* 1000), 'dd-MMM-y');
}
}
Here how can I convert timestamp to Date without considering the timezone.
For example timestampDate value 1451932200