// используется

function TimestampToHuman(TmNow, TmSt, DateOnly)
{
    var theDate = new Date(TmSt * 1000);
    var Today = new Date(TmNow * 1000);
    var Month = new Array(12);
    var FH;
    var FM;
    var Result = "";

    Month[0] = "Январь";
    Month[1] = "Февраль";
    Month[2] = "Март";
    Month[3] = "Апрель";
    Month[4] = "Май";
    Month[5] = "Июнь";
    Month[6] = "Июль";
    Month[7] = "Август";
    Month[8] = "Сентябрь";
    Month[9] = "Октябрь";
    Month[10] = "Ноябрь";
    Month[11] = "Декабрь";

    if (theDate.getHours().toString().length == 1)
		FH = "0" + theDate.getHours(); else FH = theDate.getHours();
    if (theDate.getMinutes().toString().length == 1)
		FM = "0" + theDate.getMinutes(); else FM = theDate.getMinutes();

    if (DateOnly || Today.getDate() != theDate.getDate() || Today.getMonth() != theDate.getMonth() || Today.getFullYear() != theDate.getFullYear() || (FH == "00" && FM == "00")) {
		//alert(theDate.getMonth().toString().length);
        Result = (theDate.getDate().toString().length == 1 ? "0" : "") + theDate.getDate();
		Result = Result + "." + ((theDate.getMonth() + 1).toString().length == 1 ? "0" : "") + (theDate.getMonth() + 1);
    }
	
    if (Today.getFullYear() != theDate.getFullYear() || DateOnly == 2)
		Result += " " + theDate.getFullYear();
    if (!DateOnly || DateOnly == 2) {
        if (Result && (FH != "00" || FM != "00"))
			Result += ", ";
        if (FH != "00" || FM != "00") {
			Result += FH + ":" + FM;
		}
    }
    return Result;
}