Open dipali09 opened 6 years ago
what have you put in your:
getTimeStamp(){ }
in chat.services.ts?
` getTimeStamp(){
const now=new Date();
const date=now.getFullYear()+'/'+(now.getMonth()+1)+'/'+now.getDay();
const time=now.getHours()+'/'+now.getMinutes()+'/'+now.getSeconds();
return(now);
}`
Change it to this, and it should work:
getTimeStamp(){ const now = new Date(); const date = now.getUTCFullYear() + '/' + (now.getUTCMonth() + 1) + '/' + now.getUTCDate(); const time = now.getUTCHours() + ':' + now.getUTCMinutes() + ':' + now.getUTCSeconds();
return ( date + ' ' + time );
}
I am having an error regarding timeStamp.In chat.service.ts U I am applying the code below. this.chatMessages.push({ message:msg, timeSent:this.timestamp, email:email, userName:"this.userName" }); But it's not showing anything for the timeSent on the console and not in the firebase database. I am not having any idea how to debug it.