JS_js获取当前年月日时分

js获取当前年月日时分

function GetDate(){
    
    
var now = new Date();
var year = now.getFullYear();         //年
var month = now.getMonth() + 1;     	//月
var day = now.getDate();              //日
var hh = now.getHours();              //时
var mm = now.getMinutes();             //分
}

猜你喜欢

转载自blog.csdn.net/weixin_44599931/article/details/108951595