问题:
在微信小程序中 怎么把
inputtime: "1691650127"这个时间转换成年月日的
答案:
微信有个js函数,转换时间格式的,名字忘记,你去微信社区搜索一下
直接这样使用js搞定formatTimestamp(timestamp) { let date = new Date(timestamp * 1000); let formattedDate = date.getFullYear() + '-' + (date.getMonth() + 1).toString().padStart(2, '0') + '-' + date.getDate().toString().padStart(2, '0'); return formattedDate; },
@影子:非常感谢大佬