How to convert a Chinese standard time to a date-time format?

:Wed Nov 14 2018 02:00:00 GMT+0800 ()
 2018/11/14 02:00:00  2018-11/-14 02:00:00date
toLocaleString
Nov.25,2021

Native methods are not recommended. Please use moment.js basically everyone uses this


toLocaleDateString ()


Why do you want to convert? you need to do this:

function getNowDate(){
var date = new Date(),
    year = date.getFullYear(),
    month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1,
    day = date.getDay() < 10 ? '0' + date.getDay() : date.getDay(),
    hour = date.getHours() < 10 ? '0' + date.getHours() : date.getHours(),
    minute = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes(),
    second = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
    return year + '/' + month + '/' + day + '  ' + hour + ':' + minute + ':' + second;
}


No.
write your own method.
for example:

function dateFormat(d) {
    let year = d.getFullYear();
    let month = d.getMonth() + 1 +"";
    if (month <= 9) {
        month = '0' + month;
    }
    let date = d.getDate()+"";
    if (date <= 9) {
        date = '0' + date;
    }
    let hour = d.getHours() + "";
    if (hour <= 9) {
        hour = '0' + hour;
    }
    let minute = d.getMinutes()+"";
    if (minute <= 9) {
        minute = '0' + minute;
    }
    let second = d.getSeconds() + "";
    if (second <= 9) {
        second = '0' + second;
    }
    return year + "-" + month + "-" + date + " " + hour + ":" + minute + ":" + second;
    // return year + "/" + month + "/" + date + " " + hour + ":" + minute + ":" + second;
}
dateFormat(new Date());

A solution is also provided here. See cloud-utils :

.
  https://codeshelper.com/n/13.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eb7a59-4fb40.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eb7a59-4fb40.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?