So I am using Mongodb to store datetime in an array.
2021-01-16T05:00:00.000Z
I am wanting to convert that to +8GMT time in my reactJS app.
I am wondering if there is any easy way to do this?
I tried this
function Dateformat(props){
var options = { year: 'numeric', month: 'long', day: 'numeric' };
return new Date(props.timestamp).toLocaleDateString([],options);
}
but I just get it prints the same time and date that is in the database