/*
时间戳为秒
*/
export function MonthAndDay(date) {
var date = new Date(date * 1000);
var YY = date.getFullYear() + '-';
var MM = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
var DD = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate());
var hh = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
var mm = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
var ss = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
// return YY + MM + DD + " " + hh + mm + ss;
return MM + ' / ' + DD;
}
export function ChWeek(date) {
var d = new Date(date * 1000);
var week = d.getDay();//获取星期
var str = "";
switch (week) {
case 0:
str = "星期日";
break;
case 1:
str = "星期一";
break;
case 2:
str = "星期二";
break;
case 3:
str = "星期三";
break;
case 4:
str = "星期四";
break;
case 5:
str = "星期五";
break;
case 6:
str = "星期六";
break;
}
return str
}
export function EnWeek(date) {
var d = new Date(date * 1000);
var week = d.getDay();//获取星期
var str = "";
switch (week) {
case 0:
str = "Sun";
break;
case 1:
str = "Mon";
break;
case 2:
str = "Tues";
break;
case 3:
str = "Wednes";
break;
case 4:
str = "Thurs";
break;
case 5:
str = "Fri";
break;
case 6:
str = "Satur";
break;
}
return str
}