export function validateEmail(email) {
	var re = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
	return re.test(email);
}

export function showTime(timestamp) {
	// 时间戳 
	// 此处时间戳以毫秒为单位
	let date = new Date(parseInt(timestamp) * 1000);
	let Year = date.getFullYear();
	let Moth = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
	let Day = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate());
	let Hour = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours());
	let Minute = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());
	let Sechond = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
	let GMT = Year + '-' + Moth + '-' + Day + '   ' + Hour + ':' + Minute + ':' + Sechond;
	return GMT
}

export function sj(arr) {
	let m = arr.length - 1
	let n = 0
	let result = parseInt(Math.random()*(m-n+1)+n,10)
	return arr[result];
}

export function sjz(n,m) {
	var min = Math.ceil(n); // 向上取整
	  var max = Math.floor(m); // 向下取整
	
	 let result = Math.floor(Math.random() * (max - min + 1)) + min;
	   console.log(n,m,result);
	  return result
}