ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺦﯾﺭﺎﺗ ءﺎﯿﺷﺍ


فهرست مطالب

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


:ﻢﯿﻨﮐ ﺭﺎﮐ ﺎﻫ ﺦﯾﺭﺎﺗ ﺎﺑ ﺪﻫﺩ ﯽﻣ ﻩﺯﺎﺟﺍ ﺎﻣ ﻪﺑ ﺦﯾﺭﺎﺗ ءﺎﯿﺷﺍ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ

:ﻝﺎﺳ

:ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺭﺩ ﯼﺭﺎﺟ ﻝﺎﺳ ﻦﺘﻓﺮﮔ ﺯﺍ ﯼﺍ ﻪﻧﻮﻤﻧ

<!DOCTYPE html>
<html>
<body>

<h1>JavaScript Dates</h1>
<h2>The getFullYear() Method</h2>
<p>Return the full year of a date object:</p>

<p id="demo"></p>

<script>
const d = new Date();
document.getElementById("demo").innerHTML = d.getFullYear();
</script>

</body>
</html>

:ﻩﺎﻣ

:ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺭﺩ ﯼﺭﺎﺟ ﻩﺎﻣ ﺖﻓﺎﯾﺭﺩ ﺯﺍ ﯼﺍ ﻪﻧﻮﻤﻧ

<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Dates</h1>
<h2>The getMonth() Method</h2>
<p>Return the month of a date as a number from 0 to 11.</p>
<p>To get the correct month number, you must add 1:</p>

<p id="demo"></p>

<script>
const d = new Date();
document.getElementById("demo").innerHTML = d.getMonth() + 1;
</script>

</body>
</html>

:ﺯﻭﺭ

:ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺭﺩ ﯼﺭﺎﺟ ﺯﻭﺭ ﺖﻓﺎﯾﺭﺩ ﺯﺍ ﯼﺍ ﻪﻧﻮﻤﻧ

<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Dates</h1>
<h2>The getDate() Method</h2>
<p>Return the day of a date as a number (1-31):</p>

<p id="demo"></p>

<script>
const d = new Date();
document.getElementById("demo").innerHTML = d.getDate();
</script>

</body>
</html>

:ﺎﻫ ﺖﻋﺎﺳ

:ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺭﺩ ﯼﺭﺎﺟ ﺖﻋﺎﺳ ﺖﻓﺎﯾﺭﺩ ﺯﺍ ﯼﺍ ﻪﻧﻮﻤﻧ

<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Dates</h1>
<h2>The getHours() Method</h2>
<p>Return the hours of a date as a number (0-23):</p>

<p id="demo"></p>

<script>
const d = new Date();
document.getElementById("demo").innerHTML = d.getHours();
</script>

</body>
</html>

:ﻖﯾﺎﻗﺩ

:ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺭﺩ ﯼﺭﺎﺟ ﻪﻘﯿﻗﺩ ﺖﻓﺎﯾﺭﺩ ﺯﺍ ﯽﻟﺎﺜﻣ

<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Dates</h1>
<h2>The getMinutes() Method</h2>
<p>Returns the minutes of a date as a number (0-59):</p>

<p id="demo"></p>

<script>
const d = new Date();
document.getElementById("demo").innerHTML = d.getMinutes();
</script>

</body>
</html>

:ﺎﻫ ﻪﯿﻧﺎﺛ

:ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺭﺩ ﯽﻠﻌﻓ ﻡﻭﺩ ﺖﻓﺎﯾﺭﺩ ﺯﺍ ﯼﺍ ﻪﻧﻮﻤﻧ

<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Dates</h1>
<h2>The getSeconds() Method</h2>
<p>Return the seconds of a date as a number (0-59):</p>

<p id="demo"></p>

<script>
const d = new Date();
document.getElementById("demo").innerHTML = d.getSeconds();
</script>

</body>
</html>

ﺎﻫ ﻝﺎﺜﻣ

const d = new Date();

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h1>JavaScript Dates</h1>
<h2>Using new Date()</h2>
<p>new Date() without arguments, creates a date object with the current date and time:</p>

<p id="demo"></p>

<script>
const d = new Date();
document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>
const d = new Date("2022-03-25");

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h1>JavaScript Dates</h1>
<h2>Using new Date()</h2>

<p id="demo"></p>

<script>
const d = new Date("2022-03-25");
document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>

ﺪﯿﺷﺎﺑ ﻪﺘﺷﺍﺩ ﻪﺟﻮﺗ

.ﺖﺴﯿﻧ "ﺍﺮﺟﺍ ﻝﺎﺣ ﺭﺩ" "ﺖﻋﺎﺳ" .ﺪﻨﺘﺴﻫ ﺖﺑﺎﺛ ﺦﯾﺭﺎﺗ ءﺎﯿﺷﺍ

.ﺪﻨﺘﺴﯿﻧ ﺦﯾﺭﺎﺗ ءﺎﯿﺷﺍ ،ﺪﻨﮐ ﯽﻣ ﮎﺎﺗ ﮏﯿﺗ ﺮﺗﻮﯿﭙﻣﺎﮐ ﺖﻋﺎﺳ


ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺦﯾﺭﺎﺗ ﯽﺟﻭﺮﺧ

:ﺪﻫﺩ ﯽﻣ ﺶﯾﺎﻤﻧ ﻞﻣﺎﮐ ﻦﺘﻣ ﻪﺘﺷﺭ ﮏﯾ ﻥﺍﻮﻨﻋ ﻪﺑ ﺍﺭ ﺦﯾﺭﺎﺗ ﻭ ﺪﻨﮐ ﯽﻣ ﻩﺩﺎﻔﺘﺳﺍ ﺮﮔﺭﻭﺮﻣ ﯽﻧﺎﻣﺯ ﻪﻘﻄﻨﻣ

.ﺖﺧﻮﻣﺁ ﺪﯿﻫﺍﻮﺧ ﺮﺘﺸﯿﺑ ﺭﺎﯿﺴﺑ ﺎﻫ ﺦﯾﺭﺎﺗ ﺶﯾﺎﻤﻧ ﻩﻮﺤﻧ ﺩﺭﻮﻣ ﺭﺩ ،ﺵﺯﻮﻣﺁ ﻦﯾﺍ ﻪﻣﺍﺩﺍ ﺭﺩ


ﺦﯾﺭﺎﺗ ءﺎﯿﺷﺍ ﺩﺎﺠﯾﺍ

ﺪﻧﻮﺷ ﯽﻣ ﺩﺎﺠﯾﺍ ﺎﺑ ﺦﯾﺭﺎﺗ ءﺎﯿﺷﺍ

۹ ﺵﻭﺭ ﺩﺭﺍﺩ ﺩﻮﺟﻭ ﺪﯾﺪﺟ ﺦﯾﺭﺎﺗ ءﯽﺷ ﮏﯾ ﺩﺎﺠﯾﺍ ﯼﺍﺮﺑ:

new Date()
new Date(date string)

new Date(year,month)
new Date(year,month,day)
new Date(year,month,day,hours)
new Date(year,month,day,hours,minutes)
new Date(year,month,day,hours,minutes,seconds)
new Date(year,month,day,hours,minutes,seconds,ms)

new Date(milliseconds)

()ﺪﯾﺪﺟ ﺦﯾﺭﺎﺗ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ

new Date() ﺎﺑ ﺦﯾﺭﺎﺗ ﯽﺷ ﮏﯾ ﯽﻠﻌﻓ ﻥﺎﻣﺯ ﻭ ﺦﯾﺭﺎﺗ<

ﻝﺎﺜﻣ

const d = new Date();

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h1>JavaScript Dates</h1>
<h2>Using new Date()</h2>
<p>Create a new date object with the current date and time:</p>

<p id="demo"></p>

<script>
const d = new Date();
document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>

ﺪﯾﺪﺟ ﺦﯾﺭﺎﺗ (ﺦﯾﺭﺎﺗ ﻪﺘﺷﺭ)

ﺪﯾﺪﺟ ﺦﯾﺭﺎﺗ(ﺦﯾﺭﺎﺗ ﻪﺘﺷﺭ) ﺯﺍ ﺍﺭ ﺦﯾﺭﺎﺗ ﯽﺷ ﮏﯾ

ﺎﻫ ﻝﺎﺜﻣ

const d = new Date("October 13, 2014 11:13:00");

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h1>JavaScript Dates</h1>
<h2>Using new Date()</h2>

<p>A date object can be created with a specified date and time:</p>
<p id="demo"></p>

<script>
const d = new Date("October 13, 2014 11:13:00");
document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>
const d = new Date("2022-03-25");

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h1>JavaScript Dates</h1>
<h2>Using new Date()</h2>

<p id="demo"></p>

<script>
const d = new Date("2022-03-25");
document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>

.ﺖﺳﺍ ﻩﺪﺷ ﻩﺩﺍﺩ ﺢﯿﺿﻮﺗ ﯼﺪﻌﺑ ﻞﺼﻓ ﺭﺩ ﺦﯾﺭﺎﺗ ﻪﺘﺷﺭ ﯼﺎﻫ ﺐﻟﺎﻗ


ﺪﯾﺪﺟ ﺦﯾﺭﺎﺗ (ﻩﺎﻣ ،ﻝﺎﺳ، ...)

ﺪﯾﺪﺟ ﺦﯾﺭﺎﺗ(ﻩﺎﻣ ،ﻝﺎﺳ، ...) ﺎﺑ ﺦﯾﺭﺎﺗ ﯽﺷ ﮏﯾ

:(ﺐﯿﺗﺮﺗ ﻪﺑ) ﺪﻨﻨﮐ ﯽﻣ ﺺﺨﺸﻣ ﺍﺭ ﻪﯿﻧﺎﺛ ﯽﻠﯿﻣ ﻭ ﻪﯿﻧﺎﺛ ،ﻪﻘﯿﻗﺩ ،ﺖﻋﺎﺳ ،ﺯﻭﺭ ،ﻩﺎﻣ ،ﻝﺎﺳ ﺩﺪﻋ 7

ﻝﺎﺜﻣ

const d = new Date(2018, 11, 24, 10, 33, 30, 0);

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript new Date()</h2>

<p>Using new Date(7 numbers), creates a new date object with the specified date and time:</p>

<p id="demo"></p>

<script>
const d = new Date(2018, 11, 24, 10, 33, 30, 0);
document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>

ﺪﯿﺷﺎﺑ ﻪﺘﺷﺍﺩ ﻪﺟﻮﺗ

:ﺩﺭﺎﻤﺷﯽﻣ ﻩﺎﻣ 11 ﺎﺗ 0 ﺯﺍ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ

0=ﻪﯾﻮﻧﺍﮊ.

11=ﺮﺒﻣﺎﺳﺩ.

:ﺪﻨﮐ ﯽﻣ ﻪﻓﺎﺿﺍ ﺪﻌﺑ ﻝﺎﺳ ﻪﺑ ﺍﺭ ﺰﯾﺭﺮﺳ ﺎﻣﺍ ،ﺩﻮﺷ ﯽﻤﻧ ﺎﻄﺧ ﻪﺑ ﺮﺠﻨﻣ ،11 ﺯﺍ ﺮﺗﻻﺎﺑ ﻩﺎﻣ ﮏﯾ ﻦﯿﯿﻌﺗ

:ﻥﺩﺮﮐ ﺺﺨﺸﻣ

const d = new Date(2018, 15, 24, 10, 33, 30);

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>
<h1>JavaScript new Date()</h1>

<p>JavaScript counts months from 0 to 11.</p>
<p>Specifying a month higher than 11, will not result in an error but add the overflow to the next year:</p>

<p id="demo"></p>

<script>
const d = new Date(2018, 15, 24, 10, 33, 30, 0);
document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>

:ﻪﮐ ﺖﺴﻫ ﻦﯾﺍ ﻞﺜﻣ

const d = new Date(2019, 3, 24, 10, 33, 30);

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>
<h1>JavaScript new Date()</h1>

<p>JavaScript counts months from 0 to 11.</p>

<p id="demo"></p>

<script>
const d = new Date(2019, 3, 24, 10, 33, 30, 0);
document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>

:ﺪﻨﮐ ﯽﻣ ﻪﻓﺎﺿﺍ ﺪﻌﺑ ﻩﺎﻣ ﻪﺑ ﺍﺭ ﺰﯾﺭﺮﺳ ﺎﻣﺍ ،ﺩﻮﺷ ﯽﻤﻧ ﺎﻄﺧ ﻪﺑ ﺮﺠﻨﻣ ،ﺮﺜﮐﺍﺪﺣ ﺯﺍ ﺮﺗﻻﺎﺑ ﺯﻭﺭ ﮏﯾ ﻦﯿ

:ﻥﺩﺮﮐ ﺺﺨﺸﻣ

const d = new Date(2018, 5, 35, 10, 33, 30);

:ﻪﮐ ﺖﺴﻫ ﻦﯾﺍ ﻞﺜﻣ

const d = new Date(2018, 6, 5, 10, 33, 30);

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript new Date()</h2>

<p>JavaScript counts months from 0 to 11.</p>
<p>Specifying a day higher than max, will not result in an error but add the overflow to the next month:</p>

<p id="demo"></p>

<script>
const d = new Date(2018, 05, 35, 10, 33, 30, 0);
document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>

2 ﺎﯾ 3 ،4 ،6 ﺩﺍﺪﻋﺍ ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ﺎﺑ

:ﺪﻨﮐ ﯽﻣ ﺺﺨﺸﻣ ﺍﺭ ﻪﯿﻧﺎﺛ ،ﻪﻘﯿﻗﺩ ،ﺖﻋﺎﺳ ،ﺯﻭﺭ ،ﻩﺎﻣ ،ﻝﺎﺳ ﺩﺪﻋ 6

ﻝﺎﺜﻣ

const d = new Date(2018, 11, 24, 10, 33, 30);

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript new Date()</h2>
<p>6 numbers specify year, month, day, hour, minute and second:</p>

<p id="demo"></p>

<script>
const d = new Date(2018, 11, 24, 10, 33, 30);
document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>

:ﺪﻨﮐ ﯽﻣ ﺺﺨﺸﻣ ﺍﺭ ﻪﻘﯿﻗﺩ ﻭ ﺖﻋﺎﺳ ،ﺯﻭﺭ ،ﻩﺎﻣ ،ﻝﺎﺳ ﺩﺪﻋ 5

ﻝﺎﺜﻣ

const d = new Date(2018, 11, 24, 10, 33);

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript new Date()</h2>
<p>5 numbers specify year, month, day, hour, and minute:</p>

<p id="demo"></p>

<script>
const d = new Date(2018, 11, 24, 10, 33);
document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>

:ﺪﻨﮐ ﯽﻣ ﺺﺨﺸﻣ ﺍﺭ ﺖﻋﺎﺳ ﻭ ﺯﻭﺭ ،ﻩﺎﻣ ،ﻝﺎﺳ ﺩﺪﻋ 4

ﻝﺎﺜﻣ

const d = new Date(2018, 11, 24, 10);

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript new Date()</h2>
<p>4 numbers specify year, month, day, and hour:</p>

<p id="demo"></p>

<script>
const d = new Date(2018, 11, 24, 10);
document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>

:ﺪﻨﮐ ﯽﻣ ﺺﺨﺸﻣ ﺍﺭ ﺯﻭﺭ ﻭ ﻩﺎﻣ ،ﻝﺎﺳ ﺩﺪﻋ 3

ﻝﺎﺜﻣ

const d = new Date(2018, 11, 24);

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript new Date()</h2>
<p>3 numbers specify year, month, and day:</p>

<p id="demo"></p>

<script>
const d = new Date(2018, 11, 24);
document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>

:ﺪﻨﮐ ﯽﻣ ﺺﺨﺸﻣ ﺍﺭ ﻩﺎﻣ ﻭ ﻝﺎﺳ ﺩﺪﻋ 2

ﻝﺎﺜﻣ

const d = new Date(2018, 11);

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript new Date()</h2>
<p>2 numbers specify year and  month:</p>

<p id="demo"></p>

<script>
const d = new Date(2018, 11);
document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>

.ﺩﻮﺷ ﯽﻣ ﻪﺘﻓﺮﮔ ﺮﻈﻧ ﺭﺩ ﻪﯿﻧﺎﺛ ﯽﻠﯿﻣ ﻥﺍﻮﻨﻋ ﻪﺑ ،ﺪﯿﻨﮐ ﻪﺋﺍﺭﺍ ﺍﺭ ﺮﺘﻣﺍﺭﺎﭘ ﮏﯾ ﻂﻘﻓ ﺮﮔﺍ .ﺪﯿﻨﮐ ﻑﺬﺣ

ﻝﺎﺜﻣ

const d = new Date(2018);

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript new Date()</h2>
<p>One parameter will be interpreted as new Date(milliseconds).</p>

<p id="demo"></p>

<script>
const d = new Date(2018);
document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>

ﻪﺘﺷﺬﮔ ﻥﺮﻗ

:ﺪﻧﻮﺷ ﯽﻣ ﺮﯿﺴﻔﺗ 19xx ﺕﺭﻮﺻ ﻪﺑ ﯽﻤﻗﺭ ﻭﺩ ﻭ ﮏﯾ ﯼﺎﻫ ﻝﺎﺳ

ﻝﺎﺜﻣ

const d = new Date(99, 11, 24);

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript new Date()</h2>
<p>Two digit years will be interpreted as 19xx:</p>

<p id="demo"></p>

<script>
const d = new Date(99, 11, 24);
document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>

ﻝﺎﺜﻣ

const d = new Date(9, 11, 24);

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript new Date()</h2>
<p>One digit years will be interpreted as 19xx:</p>

<p id="demo"></p>

<script>
const d = new Date(9, 11, 24);
document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>

ﺪﻨﮐ ﯽﻣ ﻩﺮﯿﺧﺫ ﻪﯿﻧﺎﺛ ﯽﻠﯿﻣ ﺕﺭﻮﺻ ﻪﺑ ﺍﺭ ﺎﻫ ﺦﯾﺭﺎﺗ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ

.ﺪﻨﮐ ﯽﻣ ﻩﺮﯿﺧﺫ 1970 ﻪﯾﻮﻧﺍﮊ 01 ﺯﺍ ﻪﯿﻧﺎﺛ ﯽﻠﯿﻣ ﺩﺍﺪﻌﺗ ﻪﺑ ﺍﺭ ﺎﻫ ﺦﯾﺭﺎﺗ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ

00:00:00 ﺖﻋﺎﺳ 1970 ﻪﯾﻮﻧﺍﮊ 01 ﺮﻔﺻ ﻥﺎﻣﺯ UTC ﺖﺳﺍ.

.ﺖﺳﺍ ﻪﯿﻧﺎﺛ ﯽﻠﯿﻣ 000 400 86 (ﺖﻋﺎﺳ 24) ﺯﻭﺭ ﮏﯾ

:ﺖﺳﺍ ﻥﺁ ﻥﺎﻣﺯ ﻥﻮﻨﮐﺍ

ﺖﺳﺍ ﻪﺘﺷﺬﮔ 1970 ﻪﯾﻮﻧﺍﮊ 01 ﺯﺍ ﻪﯿﻧﺎﺛ ﯽﻠﯿﻣ


ﺪﯾﺪﺟ ﺦﯾﺭﺎﺗ (ﻪﯿﻧﺎﺛ ﯽﻠﯿﻣ)

ﺪﯾﺪﺟ ﺦﯾﺭﺎﺗ(ﻪﯿﻧﺎﺛ ﯽﻠﯿﻣ) ﻥﺍﻮﻨﻋ ﻪﺑ ﺪﯾﺪﺟ ﺦﯾﺭﺎﺗ

ﺎﻫ ﻝﺎﺜﻣ

:ﺖﺳﺍ ﻪﯿﻧﺎﺛ ﯽﻠﯿﻣ 100 000 000 000/>ﻩﻭﻼﻋ ﻪﺑ 1970 ﻪﯾﻮﻧﺍﮊ 01

const d = new Date(100000000000);

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h1>JavaScript Dates</h1>
<h2>Using new Date()</h2>

<p>100000000000 milliseconds from January 01 1970 UTC is:</p>
<p id="demo"></p>

<script>
const d = new Date(100000000000);
document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>

:ﺖﺳﺍ ﻪﯿﻧﺎﺛ ﯽﻠﯿﻣ 100 000 000 000/>ﯼﺎﻬﻨﻣ 1970 ﻪﯾﻮﻧﺍﮊ 01

const d = new Date(-100000000000);

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h1>JavaScript Dates</h1>
<h2>Using new Date()</h2>

<p>-100000000000 milliseconds from January 01 1970 UTC is:</p>
<p id="demo"></p>

<script>
const d = new Date(-100000000000);
document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>

:24 ﺖﻋﺎﺳ ﻩﻭﻼﻋ ﻪﺑ 1970 ﻪﯾﻮﻧﺍﮊ 01

const d = new Date(24 * 60 * 60 * 1000);
// or
const d = new Date(86400000);

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h1>JavaScript Dates</h1>
<h2>Using new Date()</h2>

<p>86400000 milliseconds from January 01 1970 UTC is:</p>
<p id="demo"></p>

<script>
const d = new Date(86400000);
document.getElementById("demo").innerHTML = d;
</script>

<p>One day (24 hours) is 86,400,000 milliseconds.</p>

</body>
</html>

:ﺖﺳﺍ ﻪﯿﻧﺎﺛ ﯽﻠﯿﻣ b> 0/>ﻩﻭﻼﻋ ﻪﺑ 1970 ﻪﯾﻮﻧﺍﮊ 01

const d = new Date(0);

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h1>JavaScript Dates</h1>
<h2>Using new Date()</h2>

<p>0 milliseconds from January 01 1970 UTC is:</p>
<p id="demo"></p>

<script>
const d = new Date(0);
document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>


ﺦﯾﺭﺎﺗ ﯼﺎﻫ ﺵﻭﺭ

ﺪﯿﻨﮐ ﻞﻤﻋ ﻥﺁ ﯼﻭﺭ ﺪﻫﺩ ﯽﻣ ﻥﺎﮑﻣﺍ ﺎﻤﺷ ﻪﺑ ﺵﻭﺭ ﯼﺩﺍﺪﻌﺗ ،ﺩﻮﺷ ﯽﻣ ﺩﺎﺠﯾﺍ ﺦﯾﺭﺎﺗ ء

.ﺪﯿﻨﮐ ﻢﯿﻈﻨﺗ ﻭ ﺖﻓﺎﯾﺭﺩ ﺍﺭ ﺖﻋﺎﺳ ،ﺯﻭﺭ ،ﻩﺎﻣ ،ﻝﺎﺳ ﺪﻫﺩ ﯽﻣ ﻥﺎﮑﻣﺍ ﺎﻤﺷ ﻪﺑ ﺦﯾﺭﺎﺗ ﯼﺎﻫ ﺵﻭﺭ

.ﺖﺳﺍ ﻩﺪﺷ ﻩﺩﺍﺩ ﺶﺷﻮﭘ ﯼﺪﻌﺑ ﯼﺎﻫ ﻞﺼﻓ ﺭﺩ ﯽﻧﺎﻣﺯ ﻖﻃﺎﻨﻣ ﻭ ﺦﯾﺭﺎﺗ ﯼﺎﻫ ﺵﻭﺭ


ﺎﻫ ﺦﯾﺭﺎﺗ ﺶﯾﺎﻤﻧ

.ﺪﻨﮐ ﯽﻣ ﯽﺟﻭﺮﺧ toString() ﺵﻭﺭ ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ﺎﺑ ﺍﺭ ﺎﻫ ﺦﯾﺭﺎﺗ (ﺽﺮﻓ ﺶﯿﭘ ﺭﻮﻃ ﻪﺑ) ﺖﭙﯾﺮﮑﺳ

ﻝﺎﺜﻣ

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h1>JavaScript Dates</h1>
<h2>Using new Date()</h2>
<p>new Date() without arguments, creates a date object with the current date and time:</p>

<p id="demo"></p>

<script>
const d = new Date();
document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>

ﺩﻮﺷ ﯽﻣ ﻞﯾﺪﺒﺗ a ﻪﺑ ﺭﺎﮐﺩﻮﺧ ﺭﻮﻃ ﻪﺑ ،ﺪﯿﻫﺩ ﯽﻣ ﺶﯾﺎﻤﻧ HTML ﺭﺩ ﺍﺭ ﺦﯾﺭﺎﺗ ءﯽﺷ ﮏﯾ ﻪﮐ ﯽﻣﺎﮕﻨﻫ

ﻝﺎﺜﻣ

const d = new Date();
d.toString();

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h1>JavaScript Dates</h1>
<h2>The toString() Method</h2>

<p>Convert a date to a string:</p>
<p id="demo"></p>

<script>
const d = new Date();
document.getElementById("demo").innerHTML = d.toString();
</script>

</body>
</html>

ﺪﻨﮐ ﯽﻣ ﻞﯾﺪﺒﺗ ﺮﺗﺎﻧﺍﻮﺧ ﺦﯾﺭﺎﺗ ﮏﯾ ﻪﺑ ﺍﺭ ﺦﯾﺭﺎﺗ toDateString()

ﻝﺎﺜﻣ

const d = new Date();
d.toDateString();

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h1>JavaScript Dates</h1>
<h2>The toDateString() Method</h2>
<p>Convert a date to a date string:</p>

<p id="demo"></p>

<script>
const d = new Date();
document.getElementById("demo").innerHTML = d.toDateString();
</script>

</body>
</html>

:ﺪﻨﮐ ﯽﻣ ﻞﯾﺪﺒﺗ ﻪﺘﺷﺭ ﻪﺑ UTC ﺩﺭﺍﺪﻧﺎﺘﺳﺍ ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ﺎﺑ ﺍﺭ ﺦﯾﺭﺎﺗ ﮏﯾ

ﻝﺎﺜﻣ

const d = new Date();
d.toUTCString();

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h1>JavaScript Dates</h1>
<h2>The toUTCString() Method</h2>
<p>Convert a date to a string using the UTC standard:</p>

<p id="demo"></p>

<script>
const d = new Date();
document.getElementById("demo").innerHTML = d.toUTCString();
</script>

</body>
</html>

:ﺪﻨﮐ ﯽﻣ ﻞﯾﺪﺒﺗ ﻪﺘﺷﺭ ﻪﺑ ISO ﺩﺭﺍﺪﻧﺎﺘﺳﺍ ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ﺎﺑ ﺍﺭ ﺦﯾﺭﺎﺗ ﮏﯾ

ﻝﺎﺜﻣ

const d = new Date();
d.toISOString();

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h1>JavaScript Dates</h1>
<h2>The toISOString() Method</h2>

<p>Convert a date to a string using the ISO standard:</p>
<p id="demo"></p>

<script>
const d = new Date();
document.getElementById("demo").innerHTML = d.toISOString();
</script>

</body>
</html>

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

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

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

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

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