Home > Net >  Angular is getting wrong timestamp
Angular is getting wrong timestamp

Time:11-21

i have issues with wrong dates between backend and frontend.

The TimeStamp is saved in the DB like this: 15.11.2022, 08:45:00 (Datatype: Timestamp)

The Frontend is getting this Date: 2022-11-15T07:45:00.000 00:00 (Datatype: Date)

My TimeZone is GMT 1. What i need to configure that i get the right date?

CodePudding user response:

This is a JavaScript Timestamp equivalent. Consider using the Angular Date Pipe

<ng-container>{{yourTimestampVariable | date: 'shortDate'}}</ng-container>

Documentation on that can be found here: https://angular.io/api/common/DatePipe

  • Related