I have an angular application integrated with REST API developed with golang, on this app I have created a todo list functionality where I create todo for weekly or monthly, while creating todo I generate first timestamp with javascript and then submits it to API which created timestamp for other dates if its weekly or monthly todo. First timestamp is showing proper date time when I get it with API and show in using javascript date functions but other date's timestamps shows next day like if I save Wednesday then it shows Thursday.
As far as I know timestamps are not based on timezones so I chose timestamp instead of datetime
How can I resolve the issue ?
Following is my code to convert timestamp to date ( in required format )
let date = new Date(this.date*1000);
this.day = ("0" + date.getDate()).slice(-2);
this.month = ("0" + (date.getMonth()+1)).slice(-2);
this.year = date.getFullYear();
this.hours = ("0" + date.getHours()).slice(-2);
this.minutes = ("0" + date.getMinutes()).slice(-2);
this.seconds = ("0" + date.getSeconds()).slice(-2);
this.meridian = this.hours >= 12 ? 'pm' : 'am';
//Get name of the day and month
this.weekName = this.weekday[date.getDay()];
this.monthName = date.toLocaleString(this.locale, { month: "short" });