،ﻝﺎﺳ) ﺦﯾﺭﺎﺗ ﺮﯾﺩﺎﻘﻣ ﺪﻫﺩ ﯽﻣ ﻥﺎﮑﻣﺍ ﺎﻤﺷ ﻪﺑ ﺦﯾﺭﺎﺗ ﻢﯿﻈﻨﺗ ﯼﺎﻫ ﺵﻭﺭ
:ﺩﻮﺷ ﯽﻣ ﻩﺩﺎﻔﺘﺳﺍ ﺦﯾﺭﺎﺗ ﺯﺍ ﯽﺸﺨﺑ ﻢﯿﻈﻨﺗ ﯼﺍﺮﺑ ﺦﯾﺭﺎﺗ ﻢﯿﻈﻨﺗ ﯼﺎﻫ ﺵﻭﺭ
(31-1) ﺪﯿﻨﮐ ﻢﯿﻈﻨﺗ ﺩﺪﻋ ﮏﯾ ﻥﺍﻮﻨﻋ ﻪﺑ ﺍﺭ ﺯﻭﺭ
(ﺯﻭﺭ ﻭ ﻩﺎﻣ ﯼﺭﺎﯿﺘﺧﺍ) ﺪﯿﻨﮐ ﻢﯿﻈﻨﺗ ﺍﺭ ﻝﺎﺳ
(23-0) ﺖﻋﺎﺳ ﻢﯿﻈﻨﺗ
(999-0) ﻪﯿﻧﺎﺛ ﯽﻠﯿﻣ ﻢﯿﻈﻨﺗ
(59-0) ﻪﻘﯿﻗﺩ ﻢﯿﻈﻨﺗ
(11-0) ﻩﺎﻣ ﻢﯿﻈﻨﺗ
(59-0) ﻪﯿﻧﺎﺛ ﻢﯿﻈﻨﺗ
(1970 ﻪﯾﻮﻧﺍﮊ 1 ﺯﺍ ﻪﯿﻧﺎﺛ ﯽﻠﯿﻣ) ﻥﺎﻣﺯ ﻢﯿﻈﻨﺗ
:2020 ﻝﺎﺳ ﺎﺗ ﻝﺎﺜﻣ ﻦﯾﺍ ﺭﺩ .ﺪﻨﮐ ﯽﻣ ﻢﯿﻈﻨﺗ ﺍﺭ ﺦﯾﺭﺎﺗ ﯽﺷ ﮏﯾ ﻝﺎﺳ s
const d = new Date();
d.setFullYear(2020);
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript setFullYear()</h2>
<p>The setFullYear() method sets the year of a date object:</p>
<p id="demo"></p>
<script>
const d = new Date();
d.setFullYear(2020);
document.getElementById("demo").innerHTML = d;
</script>
</body>
</html>
:ﺪﻨﮐ ﻢﯿﻈﻨﺗ ﺍﺭ ﺯﻭﺭ ﻭ ﻩﺎﻣ ﯼﺭﺎﯿﺘﺧﺍ ﺪﻧﺍﻮﺗ ﯽﻣ s
const d = new Date();
d.setFullYear(2020, 11, 3);
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript setFullYear()</h2>
<p>The setFullYear() method can optionally set month and day.</p>
<p>Please note that month counts from 0. December is month 11:</p>
<p id="demo"></p>
<script>
const d = new Date();
d.setFullYear(2020, 11, 3);
document.getElementById("demo").innerHTML = d;
</script>
</body>
</html>
:(11-0) ﺪﻨﮐ ﯽﻣ ﻢﯿﻈﻨﺗ ﺍﺭ ﺦﯾﺭﺎﺗ ﯽﺷ ﮏﯾ ﻩﺎﻣ setMonth()
ﺵ
const d = new Date();
d.setMonth(11);
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript setMonth()</h2>
<p>The setMonth() method sets the mont of a date object.</p>
<p>Note that months count from 0. December is month 11:</p>
<p id="demo"></p>
<script>
const d = new Date();
d.setMonth(11);
document.getElementById("demo").innerHTML = d;
</script>
</body>
</html>
:(31-1) ﺪﻨﮐ ﯽﻣ ﻢﯿﻈﻨﺗ ﺍﺭ ﺦﯾﺭﺎﺗ ءﯽﺷ ﺯﻭﺭ setDate()
ﺵﻭﺭ
const d = new Date();
d.setDate(15);
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript setDate()</h2>
<p>The setDate() method sets the day of a date object:</p>
<p id="demo"></p>
<script>
const d = new Date();
d.setDate(15);
document.getElementById("demo").innerHTML = d;
</script>
</body>
</html>
:ﺩﻮﺷ ﻩﺩﺎﻔﺘﺳﺍ ﺦﯾﺭﺎﺗ ﻪﺑ ﺯﻭﺭ ﻥﺩﻭﺰﻓﺍ ﯼﺍﺮﺑ ﺪﻧﺍﻮﺗ ﯽﻣ ﻦﯿﻨﭽﻤﻫ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ ﻝﺎﺜﻣ
const d = new Date();
d.setDate(d.getDate() + 50);
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript setDate()</h2>
<p>The setDate() method can be used to add days to a date.</p>
<p id="demo"></p>
<script>
const d = new Date();
d.setDate(d.getDate() + 50);
document.getElementById("demo").innerHTML = d;
</script>
</body>
</html>
.ﺩﻮﺷ ﯽﻣ ﻡﺎﺠﻧﺍ Date ﯽﺷ ﻂﺳﻮﺗ ﺭﺎﮐﺩﻮﺧ ﺭﻮﻃ ﻪﺑ ﺕﺍﺮﯿﯿﻐﺗ ،ﺪﻫﺩ ﺮﯿﯿﻐﺗ ﺍﺭ ﻝﺎﺳ ﺎﯾ ﻩﺎﻣ ﺎﻫﺯﻭﺭ ﻥﺩﺮﮐ
:(23-0) ﺪﻨﮐﯽﻣ ﻢﯿﻈﻨﺗ ﺍﺭ ﺦﯾﺭﺎﺗ ﯽﺷ ﮏﯾ ﯼﺎﻫﺖﻋﺎﺳ setHou
const d = new Date();
d.setHours(22);
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript setHours()</h2>
<p>The setHours() method sets the hours of a date object:</p>
<p id="demo"></p>
<script>
const d = new Date();
d.setHours(22);
document.getElementById("demo").innerHTML = d;
</script>
</body>
</html>
:(59-0) ﺪﻨﮐ ﯽﻣ ﻢﯿﻈﻨﺗ ﺍﺭ ﺦﯾﺭﺎﺗ ءﯽﺷ ﮏﯾ ﻪﻘﯿﻗﺩ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ :(59-0) ﺪﻨﮐ ﯽﻣ ﻢﯿﻈﻨﺗ ﺍﺭ ﺦﯾﺭﺎﺗ ءﯽﺷ ﮏﯾ ﯼﺎﻫ ﻪﯿﻧﺎﺛ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ .ﺪﻨﺘﺴﻫ ﻪﺴﯾﺎﻘﻣ ﻞﺑﺎﻗ ﯽﺘﺣﺍﺭ ﻪﺑ ﺎﻫ ﺦﯾﺭﺎﺗ :ﺪﻨﮐ ﯽﻣ ﻪﺴﯾﺎﻘﻣ 2100 ﻪﯾﻮﻧﺍﮊ 14 ﺎﺑ ﺍﺭ ﺯﻭﺮﻣﺍ ﺦﯾﺭﺎﺗ ﺮﯾﺯ ﻝﺎﺜﻣ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ .ﺖﺳﺍ 11 ﺮﺒﻣﺎﺳﺩ ﻭ ﺖﺳﺍ 0 ﻪﯾﻮﻧﺍﮊ .ﺩﺭﺎﻤﺷ ﯽﻣ 11 ﺎﺗ 0 ﺯﺍ ﺍﺭ ﺎﻫ ﻩﺎﻣ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ :ﺪﯿﻨﮐ ﻪﻌﺟﺍﺮﻣ ﺎﻣ ﻪﺑ ،ﺦﯾﺭﺎﺗ ﻞﻣﺎﮐ ﻊﺟﺮﻣ ﮏﯾ ﯼﺍﺮﺑ .ﻞﻣﺎﮐ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺦﯾﺭﺎﺗ ﻊﺟﺮﻣ ﻭ ﺦﯾﺭﺎﺗ ﯼﺎﻫ ﯽﮔﮋﯾﻭ ﻡﺎﻤﺗ ﺯﺍ ﯽﯾﺎﻫ ﻪﻧﻮﻤﻧ ﻭ ﺕﺎﺤﯿﺿﻮﺗ ﯼﻭﺎﺣ ﻊﺟﺮﻣsetMinutes()
ﻝﺎﺜﻣ
const d = new Date();
d.setMinutes(30);
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript setMinutes()</h2>
<p>The setMinutes() method sets the minutes of a date object (0-59):</p>
<p id="demo"></p>
<script>
const d = new Date();
d.setMinutes(30);
document.getElementById("demo").innerHTML = d;
</script>
</body>
</html>
.()setSeconds ﺪﺘﻣ
setSeconds()
ﻝﺎﺜﻣ
const d = new Date();
d.setSeconds(30);
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript setSeconds()</h2>
<p>The setSeconds() method sets the seconds of a date object (0-59):</p>
<p id="demo"></p>
<script>
const d = new Date();
d.setSeconds(30);
document.getElementById("demo").innerHTML = d;
</script>
</body>
</html>
ﺎﻫ ﺦﯾﺭﺎﺗ ﻪﺴﯾﺎﻘﻣ
ﻝﺎﺜﻣ
let text = "";
const today = new Date();
const someday = new Date();
someday.setFullYear(2100, 0, 14);
if (someday > today) {
text = "Today is before January 14, 2100.";
} else {
text = "Today is after January 14, 2100.";
}
<!DOCTYPE html>
<html>
<body>
<p id="demo"></p>
<script>
let text;
const today = new Date();
const someday = new Date();
someday.setFullYear(2100, 0, 14);
if (someday > today) {
text = "Today is before January 14, 2100.";
} else {
text = "Today is after January 14, 2100.";
}
document.getElementById("demo").innerHTML = text;
</script>
</body>
</html>
ﻞﻣﺎﮐ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺦﯾﺭﺎﺗ ﻊﺟﺮﻣ