var myDate = new Date(); //获取当前的系统日期和时间
var year = myDate.getFullYear();//获取系统时间年份
var date = myDate.getDate();
var time ='';
var month = myDate.getMonth()
//var month = 7 //测试数据
if (date>=1 && date<=3) { //因为有延迟,每月3号前,则取上月数据
var month = month //获取系统时间对应上月月份数字
}else{
month = month + 1 //获取当月月份数字
}
if (month >= 1 && month <= 9) { //小于10的月份补充0
time = year+'0'+month
}else{
time = year+''+month
}
msg.payload = {
"eleCustId":"xxxXB4PS","areaCode":"xxx000","meteringPointId":"xxx381bb2b9487e6e0c2b6b6bb9b4xxx","yearMonth":time
}
return msg;
var myDate = new Date(); //获取当前的系统日期和时间
var year = myDate.getFullYear();//获取系统时间年份
var date = myDate.getDate();
var time ='';
var month = myDate.getMonth()
//var month = 7 //测试数据
if (date>=1 && date<=3) { //因为有延迟,每月3号前,则取上月数据
var month = month //获取系统时间对应上月月份数字
}else{
month = month + 1 //获取当月月份数字
}
if (month >= 1 && month <= 9) { //小于10的月份补充0
time = year+'0'+month
}else{
time = year+''+month
}
msg.payload = {
"eleCustId":"xxxXB4PS","areaCode":"xxx000","meteringPointId":"xxx381bb2b9487e6e0c2b6b6bb9b4xxx","yearMonth":time
}
return msg;