Kindly help with displaying correct datetime stamp.
E.g. Time on my Laptop: 02-Oct-2021 11:14am (this is in India)
Time stored by Node and Displayed in Angular 2021-10-02T05:44:09.022Z, i.e. 06:30 behind my time.
And this is being executed in dev mode on localhost, so it should display my laptop's time right?
Here is the code in the Node.js while saving one comment.
const comment = {
comment: remarks,
userName: user.userName,
commentBy: user.employeeName,
commentedOn: new Date()
}
clientDoc.commentsArr.push(comment)
await clientDoc.save();
and here is the code in Angular template.
<div *ngIf="clientDoc" class="container">
<span class="subTitle">Existing Comments:</span>
<table style="width: 100%">
<tr *ngFor="let e of clientDoc?.commentsArr, let i =index">
<span style="font-style: italic; font-weight: 500;">{{i + 1}}. {{e.commentBy}} ( {{e.commentedOn}} ) : </span>
<span *ngIf="account.role !== 'Client'">
<a class="link small" (click)="onEditRemarks(e._id, e.comment)">Edit</a>
</span>
<br>
<span style="font-weight: 350;">{{e.comment}}</span>
</tr>
</table>
</div>
And here is the timestamp stored in MongoDb
2021-10-02T05:44:09.022+00:00
I need to sort this both for the dev mode, as well as when I deploy this code on VPS - which is also in India.