如何将 datetime类型转化为string类型?

小程序 文章 2022-04-06 09:20 1536 0 全屏看文

AI助手支持GPT4.0

如何将 datetime类型转化为string类型?How to convert datetime type to string type?

如何将 datetime类型转化为string类型?

如图,ReleaseTime在数据库是DateTime类型,在小程序获取后成为如图的数据,在网上搜索,大部分是时间戳转化为字符串,感觉跟我遇到的问题不同。求大佬给个思路

As shown in the figure, releasetime is of datetime type in the database, which becomes the data shown in the figure after being obtained by the applet. When searching on the Internet, most of the time stamps are converted into strings, which feels different from the problems I encounter. Ask the boss for a thought

回答:

romantik:232
小黎:

releaseTime.split("T")[0]+" "+releaseTime.split("T")[1].split(".")[0]

武曲心:

moment.js或者在渲染是用wxs转换

-EOF-

AI助手支持GPT4.0