<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<script>
Date.prototype.setTimezoneOffset = function(minutes) {
var _minutes;
if (this.timezoneOffset == _minutes) {
_minutes = this.getTimezoneOffset();
} else {
_minutes = this.timezoneOffset;
}
if (arguments.length) {
this.timezoneOffset = minutes;
} else {
this.timezoneOffset = minutes = this.getTimezoneOffset();
}
return this.setTime(this.getTime() + (_minutes - minutes) * 6e4);
};
function getDate(hoursEnd, timeZone)
{
var time = new Date;
time.setTimezoneOffset(-180);
var hours = time.getHours();
if(hours >= hoursEnd) time.setDate(time.getDate() + 1);
return time.toLocaleString('ru', {
year: 'numeric',
month: 'long',
day: 'numeric'
});
}
addEventListener('load', () => document.querySelector('.executionDate').textContent = getDate(16, -180))
</script>
</head>
<body>
<div class="executionDate"></div>
</body>
</html>
...
Igor_Gerasimov,
Учебник