我可以帮您进行翻译。以下是需要翻译的内容:
我正在进行一个Firebase项目,在显示实体相关时间时,我得到的是时间戳。我正在进行一个React Native项目。如何将接收到的时间戳转换为格式正确的日期。 这是时间戳:
我有这段时间可用于this.props.time
,所以我尝试了this.props.time.toDate()
,但是我得到了一个错误。Invariant Violation: Objects are not valid as a React child(found: Tue Nov 26 2019 11:51:58 GMT+05:30(Indian Standard Time))
new Date(this.props.time.seconds * 1000)
的格式 - VilleKoo