Within my response, the field
createdate: "2019-04-19T15:47:48.000+0000"
is of type Date
. I am looking to display it in my grid with a different format such as createdate: "19/04/2019, 18:47:48"
while maintaining its original data type.
To achieve this, I convert it into a string and utilize the following code snippet:
this.createdate = this.datePipe.transform(this.createdate, 'dd/MM/yyyy, HH:mm:ss');
However, the function datePipe.transform returns a string value similar to formatDate. Is there a way to accomplish this task without changing the data type?