function TimeUtil() {
}


TimeUtil.getFullHourFromMS = function(timeMS) {
	return Math.floor(timeMS / TimeUtil.HOUR_MS);
}

TimeUtil.getHourFromMS = function(timeMS) {
	return TimeUtil.getFullHourFromMS(timeMS) % 24;
}

TimeUtil.getTwoDigitHourFromMS = function(timeMS) {
	var twoDigitHour = TimeUtil.getHourFromMS(timeMS);
	return StringUtil.getNumberStartWithZero(twoDigitHour, 2);
}


TimeUtil.getFullMinuteFromMS = function(timeMS) {
	return Math.floor(timeMS / TimeUtil.MINUTE_MS);
}

TimeUtil.getMinuteFromMS = function(timeMS) {
	return TimeUtil.getFullMinuteFromMS(timeMS) % 60;
}

TimeUtil.getTwoDigitMinuteFromMS = function(timeMS) {
	var twoDigitMinute = TimeUtil.getMinuteFromMS(timeMS);
	return StringUtil.getNumberStartWithZero(twoDigitMinute, 2);
}


TimeUtil.getFullSecondFromMS = function(timeMS) {
	return Math.floor(timeMS / TimeUtil.SECOND_MS);
}

TimeUtil.getSecondFromMS = function(timeMS) {
	return TimeUtil.getFullSecondFromMS(timeMS) % 60;
}

TimeUtil.getTwoDigitSecondFromMS = function(timeMS) {
	var twoDigitSecond = TimeUtil.getSecondFromMS(timeMS);
	return StringUtil.getNumberStartWithZero(twoDigitSecond, 2);
}




TimeUtil.getFullHourFromSec = function(timeSec) {
	return Math.floor(timeSec / TimeUtil.HOUR_SEC);
}

TimeUtil.getHourFromSec = function(timeSec) {
	return TimeUtil.getFullHourFromSec(timeSec) % 24;
}

TimeUtil.getTwoDigitHourFromSec = function(timeSec) {
	var twoDigitHour = TimeUtil.getHourFromSec(timeSec);
	return StringUtil.getNumberStartWithZero(twoDigitHour, 2);
}


TimeUtil.getFullMinuteFromSec = function(timeSec) {
	return Math.floor(timeSec / TimeUtil.MINUTE_SEC);
}

TimeUtil.getMinuteFromSec = function(timeSec) {
	return TimeUtil.getFullMinuteFromSec(timeSec) % 60;
}

TimeUtil.getTwoDigitMinuteFromSec = function(timeSec) {
	var twoDigitMinute = TimeUtil.getMinuteFromSec(timeSec);
	return StringUtil.getNumberStartWithZero(twoDigitMinute, 2);
}


TimeUtil.getFullSecondFromSec = function(timeSec) {
	return Math.floor(timeSec / TimeUtil.SECOND_SEC);
}

TimeUtil.getSecondFromSec = function(timeSec) {
	return TimeUtil.getFullSecondFromSec(timeSec) % 60;
}

TimeUtil.getTwoDigitSecondFromSec = function(timeSec) {
	var twoDigitSecond = TimeUtil.getSecondFromSec(timeSec);
	return StringUtil.getNumberStartWithZero(twoDigitSecond, 2);
}



TimeUtil.printTimeFromSec = function(timeSec) {
	var fullTime = "";

	var twoDigitHour = TimeUtil.getTwoDigitHourFromSec(timeSec);
	if(twoDigitHour !== "00")
		fullTime = twoDigitHour + "시간 ";

	var twoDigitMinute = TimeUtil.getTwoDigitMinuteFromSec(timeSec);
	if(twoDigitMinute !== "00")
		fullTime = fullTime + twoDigitMinute + "분 ";

	var twoDigitSecond = TimeUtil.getTwoDigitSecondFromSec(timeSec);
	fullTime = fullTime + twoDigitSecond + "초";

	return fullTime;
}


TimeUtil.printHHMMSSFromSec = function(timeSec) {
	var fullTime = "";

	var twoDigitHour = TimeUtil.getTwoDigitHourFromSec(timeSec);
	if(twoDigitHour !== "00")
		fullTime = twoDigitHour + ":";

	var twoDigitMinute = TimeUtil.getTwoDigitMinuteFromSec(timeSec);
	if(twoDigitMinute !== "00")
		fullTime = fullTime + twoDigitMinute + ":";

	var twoDigitSecond = TimeUtil.getTwoDigitSecondFromSec(timeSec);
	fullTime = fullTime + twoDigitSecond;

	return fullTime;
}





TimeUtil.getYYYYMMDD = function(date) {
	// return date.toISOString().slice(0,10);
	return TimeUtil.getFullYear(date) + "-"
		+ TimeUtil.getFullMonth(date) + "-"
		+ TimeUtil.getFullDate(date);
}

TimeUtil.getHHMMSS = function(date) {
	return TimeUtil.getFullHours(date) + ":"
		+ TimeUtil.getFullMinutes(date) + ":"
		+ TimeUtil.getFullSeconds(date);
}

TimeUtil.printMonthDay = function(date) {
	// var dateTime = new Date(date);
	var a = date.split(" ");
	var d = a[0].split("-");
	var t = "0:0:0".split(":");
	if(a.count > 0)
		var t = a[1].split(":");
	var dateTime = new Date(d[0],(d[1]-1),d[2],t[0],t[1],t[2]);
	return TimeUtil.getFullMonth(dateTime) + "월 " + TimeUtil.getFullDate(dateTime) + "일";
}


TimeUtil.SECOND_MS	= 1000;
TimeUtil.MINUTE_MS	= TimeUtil.SECOND_MS * 60;
TimeUtil.HOUR_MS	= TimeUtil.MINUTE_MS * 60;
TimeUtil.DAY_MS		= TimeUtil.HOUR_MS * 24;


TimeUtil.SECOND_SEC	= 1;
TimeUtil.MINUTE_SEC	= TimeUtil.SECOND_SEC * 60;
TimeUtil.HOUR_SEC	= TimeUtil.MINUTE_SEC * 60;
TimeUtil.DAY_SEC	= TimeUtil.HOUR_SEC * 24;