当我使用
var today = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate());
我知道today
是Tue Jan 14 00:00:00 GMT+02:00 2020
如果我做today.toDateString()
,那么我会得到Tue Jan 14 2020
如果将最后一个结果存储到单元格中,如何将其转换回原来的状态? (Date
个对象)
答案 0 :(得分:1)
尝试如下,
...
FROM wp_users u
LEFT JOIN wp_usermeta ma ON u.ID = ma.user_id AND ma.meta_key = 'Address'
LEFT JOIN wp_usermeta mm ON u.ID = mm.user_id AND mm.meta_key = 'mobile_number'
LEFT JOIN wp_usermeta mp ON u.ID = mp.user_id AND mp.meta_key = 'phone_number'
LEFT JOIN wp_usermeta mc2 ON u.ID = mc2.user_id AND mc2.meta_key = 'user_city'
LEFT JOIN wp_usermeta ms ON u.ID = ms.user_id AND ms.meta_key = 'user_state'
LEFT JOIN wp_usermeta mz ON u.ID = mz.user_id AND mz.meta_key = 'user_zip'
...
答案 1 :(得分:1)
是的,有4种方法可以在JavaScript中创建新的Date
对象:
new Date()
new Date(year, month, day, hours, minutes, seconds, milliseconds)
new Date(milliseconds)
new Date(date string)
最后一个解决您的问题:
let now = new Date();
let today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
console.log(today);
let today2 = new Date(today.toString());
console.log(today2);