ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺦﯾﺭﺎﺗ ﻢﯿﻈﻨﺗ ﯼﺎﻫ ﺵﻭﺭ


فهرست مطالب

    نمایش فهرست مطالب


،ﻝﺎﺳ) ﺦﯾﺭﺎﺗ ﺮﯾﺩﺎﻘﻣ ﺪﻫﺩ ﯽﻣ ﻥﺎﮑﻣﺍ ﺎﻤﺷ ﻪﺑ ﺦﯾﺭﺎﺗ ﻢﯿﻈﻨﺗ ﯼﺎﻫ ﺵﻭﺭ


ﺪﯿﻨﮐ ﻢﯿﻈﻨﺗ ﺍﺭ ﺦﯾﺭﺎﺗ ﯼﺎﻫﺵﻭﺭ

:ﺩﻮﺷ ﯽﻣ ﻩﺩﺎﻔﺘﺳﺍ ﺦﯾﺭﺎﺗ ﺯﺍ ﯽﺸﺨﺑ ﻢﯿﻈﻨﺗ ﯼﺍﺮﺑ ﺦﯾﺭﺎﺗ ﻢﯿﻈﻨﺗ ﯼﺎﻫ ﺵﻭﺭ

setDate()

(31-1) ﺪﯿﻨﮐ ﻢﯿﻈﻨﺗ ﺩﺪﻋ ﮏﯾ ﻥﺍﻮﻨﻋ ﻪﺑ ﺍﺭ ﺯﻭﺭ

setFullYear()

(ﺯﻭﺭ ﻭ ﻩﺎﻣ ﯼﺭﺎﯿﺘﺧﺍ) ﺪﯿﻨﮐ ﻢﯿﻈﻨﺗ ﺍﺭ ﻝﺎﺳ

setHours()

(23-0) ﺖﻋﺎﺳ ﻢﯿﻈﻨﺗ

setMilliseconds()

(999-0) ﻪﯿﻧﺎﺛ ﯽﻠﯿﻣ ﻢﯿﻈﻨﺗ

setMinutes()

(59-0) ﻪﻘﯿﻗﺩ ﻢﯿﻈﻨﺗ

setMonth()

(11-0) ﻩﺎﻣ ﻢﯿﻈﻨﺗ

setSeconds()

(59-0) ﻪﯿﻧﺎﺛ ﻢﯿﻈﻨﺗ

setTime()

(1970 ﻪﯾﻮﻧﺍﮊ 1 ﺯﺍ ﻪﯿﻧﺎﺛ ﯽﻠﯿﻣ) ﻥﺎﻣﺯ ﻢﯿﻈﻨﺗ


.()setFullYear ﺪﺘﻣ

: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>


.()setMonth ﺪﺘﻣ

:(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>

.()setDate ﺪﺘﻣ

:(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 ﯽﺷ ﻂﺳﻮﺗ ﺭﺎﮐﺩﻮﺧ ﺭﻮﻃ ﻪﺑ ﺕﺍﺮﯿﯿﻐﺗ ،ﺪﻫﺩ ﺮﯿﯿﻐﺗ ﺍﺭ ﻝﺎﺳ ﺎﯾ ﻩﺎﻣ ﺎﻫﺯﻭﺭ ﻥﺩﺮﮐ


.()setHours ﺪﺘﻣ

:(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>

.()setMinutes ﺪﺘﻣ

:(59-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 ﺪﺘﻣ

:(59-0) ﺪﻨﮐ ﯽﻣ ﻢﯿﻈﻨﺗ ﺍﺭ ﺦﯾﺭﺎﺗ ءﯽﺷ ﮏﯾ ﯼﺎﻫ ﻪﯿﻧﺎﺛ 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>

ﺎﻫ ﺦﯾﺭﺎﺗ ﻪﺴﯾﺎﻘﻣ

.ﺪﻨﺘﺴﻫ ﻪﺴﯾﺎﻘﻣ ﻞﺑﺎﻗ ﯽﺘﺣﺍﺭ ﻪﺑ ﺎﻫ ﺦﯾﺭﺎﺗ

:ﺪﻨﮐ ﯽﻣ ﻪﺴﯾﺎﻘﻣ 2100 ﻪﯾﻮﻧﺍﮊ 14 ﺎﺑ ﺍﺭ ﺯﻭﺮﻣﺍ ﺦﯾﺭﺎﺗ ﺮﯾﺯ ﻝﺎﺜﻣ

ﻝﺎﺜﻣ

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>

.ﺖﺳﺍ 11 ﺮﺒﻣﺎﺳﺩ ﻭ ﺖﺳﺍ 0 ﻪﯾﻮﻧﺍﮊ .ﺩﺭﺎﻤﺷ ﯽﻣ 11 ﺎﺗ 0 ﺯﺍ ﺍﺭ ﺎﻫ ﻩﺎﻣ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ

ﻞﻣﺎﮐ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺦﯾﺭﺎﺗ ﻊﺟﺮﻣ

:ﺪﯿﻨﮐ ﻪﻌﺟﺍﺮﻣ ﺎﻣ ﻪﺑ ،ﺦﯾﺭﺎﺗ ﻞﻣﺎﮐ ﻊﺟﺮﻣ ﮏﯾ ﯼﺍﺮﺑ

.ﻞﻣﺎﮐ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺦﯾﺭﺎﺗ ﻊﺟﺮﻣ

ﻭ ﺦﯾﺭﺎﺗ ﯼﺎﻫ ﯽﮔﮋﯾﻭ ﻡﺎﻤﺗ ﺯﺍ ﯽﯾﺎﻫ ﻪﻧﻮﻤﻧ ﻭ ﺕﺎﺤﯿﺿﻮﺗ ﯼﻭﺎﺣ ﻊﺟﺮﻣ

تمامی حقوق محفوظ است. © BasicIT.org • 2023-2024