function dateToString( date ) {
	var str = "";
	if (date) {
		if (date.getDate() < 10) { str += "0"+date.getDate(); } else { str += date.getDate(); }
		if (date.getMonth() < 9) { str += ".0"+(date.getMonth()+1); } else { str += "."+(date.getMonth()+1); }
		str += "."+date.getFullYear();
	}
	return str;
};
function currentTime() {
	var str = "";
	var date = new Date();
	if (date) {
		if (date.getHours() < 10) { str += "0"+date.getHours(); } else { str += date.getHours(); }
		if (date.getMinutes() < 10) { str += ":0"+date.getMinutes(); } else { str += ":"+date.getMinutes(); }
	}
	return str;
};
function stringToDate( string ) {
	var matches;
	if (matches = string.match(/^(\d{4,4})-(\d{2,2})-(\d{2,2})$/)) {
		return new Date(matches[1], matches[2] - 1, matches[3]);
	} else {
		return null;
	};
};
function localeStringToDate( string ) {
	var matches;
	if (matches = string.match(/^(\d{2,2})\.(\d{2,2})\.(\d{4,4})$/)) {
		return new Date(matches[3], matches[2] - 1, matches[1]);
	} else {
		return null;
	};
}
