ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺦﯾﺭﺎﺗ ﯼﺎﻫ ﺖﻣﺮﻓ


فهرست مطالب

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


ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺦﯾﺭﺎﺗ ﯼﺩﻭﺭﻭ

:ﺩﺭﺍﺩ ﺩﻮﺟﻭ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺦﯾﺭﺎﺗ ﯼﺩﻭﺭﻭ ﺖﻣﺮﻓ ﻉﻮﻧ 3 ﯽﻠﮐ ﺭﻮﻃ ﻪﺑ

ISO Date

(ﯽﻠﻠﻤﻟﺍ ﻦﯿﺑ ﺩﺭﺍﺪﻧﺎﺘﺳﺍ) "2015-03-25"

Short Date

"03/25/2015"

Long Date

«2015 ﺱﺭﺎﻣ 25» ﺎﯾ «2015 ﺱﺭﺎﻣ 25»

.ﺪﻨﮐ ﯽﻣ ﯼﻭﺮﯿﭘ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺭﺩ ﻪﻧﺍﺮﯿﮕﺘﺨﺳ ﺩﺭﺍﺪﻧﺎﺘﺳﺍ ﮏﯾ ﺯﺍ ISO ﺖﻣﺮﻓ

ﺪﻨﺘﺴﯿﻧ ﺮﮕﯾﺩ ﯼﺎﻫ ﺖﻣﺮﻓ


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

ﺪﻨﮐ ﯽﻣ ﯽﺟﻭﺮﺧ ﻞﻣﺎﮐ ﺭﻮﻃ ﻪﺑ ﺍﺭ ﺎﻫ ﺦﯾﺭﺎﺗ (ﺽﺮﻓ ﺶﯿﭘ ﺭﻮﻃ ﻪﺑ) ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ،ﯼﺩﻭﺭﻭ ﺖﻣﺮﻓ ﺯﺍ ﻞﻘﺘ


ISO JavaScript ﯼﺎﻫ ﺦﯾﺭﺎﺗ

ISO 8601 ﻭ ﺎﻣﺮﺧ ﺶﯾﺎﻤﻧ ﯼﺍﺮﺑ ﯽﻠﻠﻤﻟﺍ ﻦﯿﺑ ﺩﺭﺍﺪﻧﺎﺘﺳﺍ

:ﺖﺳﺍ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺦﯾﺭﺎﺗ ﯽﺤﯿﺟﺮﺗ ﺐﻟﺎﻗ ﺰﯿﻧ ISO 8601 (YYYY-MM-DD) ﻮﺤﻧ

(ﻞﻣﺎﮐ ﺦﯾﺭﺎﺗ) ﻝﺎﺜﻣ

const d = new Date("2015-03-25");

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

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript ISO Dates</h2>

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

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

</body>
</html>

ﻻﺎﺑ ﻪﺠﯿﺘﻧ ،ﺎﻤﺷ ﯽﻧﺎﻣﺯ ﻪﻘﻄﻨﻣ ﻪﺑ ﻪﺘﺴﺑ
.ﺩﻮﺑ ﺪﻫﺍﻮﺧ ﺎﻤﺷ ﯽﻧﺎﻣﺯ ﻪﻘﻄﻨﻣ ﻪﺑ ﺖﺒﺴﻧ ﻩﺪﺷ ﻪﺒﺳﺎﺤﻣ ﺦ



(ﻩﺎﻣ ﻭ ﻝﺎﺳ) ISO ﺦﯾﺭﺎﺗ

:ﺖﺷﻮﻧ (YYYY-MM) ﺯﻭﺭ ﻦﯿﯿﻌﺗ ﻥﻭﺪﺑ ﻥﺍﻮﺗ ﯽﻣ ﺍﺭ ISO ﯼﺎﻫ ﺦﯾﺭﺎﺗ

ﻝﺎﺜﻣ

const d = new Date("2015-03");

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

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript ISO Dates</h2>

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

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

</body>
</html>

.ﺩﺮﮐ ﺪﻫﺍﻮﺧ ﺕﻭﺎﻔﺘﻣ ﺱﺭﺎﻣ 01 ﻭ ﻪﯾﺭﻮﻓ 28 ﻦﯿﺑ ﺍﺭ ﻻﺎﺑ ﺞﯾﺎﺘﻧ ﯽﻧﺎﻣﺯ ﻖﻃﺎﻨﻣ


(ﻝﺎﺳ ﻂﻘﻓ) ISO ﯼﺎﻫ ﺦﯾﺭﺎﺗ

:(YYYY) ﺖﺷﻮﻧ ﺯﻭﺭ ﻭ ﻩﺎﻣ ﻥﻭﺪﺑ ﻥﺍﻮﺗ ﯽﻣ ﺍﺭ ISO ﯼﺎﻫ ﺦﯾﺭﺎﺗ

ﻝﺎﺜﻣ

const d = new Date("2015");

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

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript ISO Dates</h2>

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

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

</body>
</html>

.ﺩﺍﺩ ﺪﻨﻫﺍﻮﺧ ﺮﯿﯿﻐﺗ 2015 ﻪﯾﻮﻧﺍﮊ 01 ﻭ 2014 ﺮﺒﻣﺎﺳﺩ 31 ﻦﯿﺑ ﺍﺭ ﻕﻮﻓ ﺞﯾﺎﺘﻧ ﯽﻧﺎﻣﺯ ﻖﻃﺎﻨﻣ


(ﻥﺎﻣﺯ-ﺦﯾﺭﺎﺗ) ISO ﺦﯾﺭﺎﺗ

ﺩﺮﮐ ﻪﻓﺎﺿﺍ ﻪﯿﻧﺎﺛ ﻭ ﻪﻘﯿﻗﺩ ،ﺖﻋﺎﺳ ﺎﺑ ﻥﺍﻮﺗ ﯽﻣ ﺍﺭ ISO ﯼﺎﻫ ﺦﯾﺭﺎﺗ

ﻝﺎﺜﻣ

const d = new Date("2015-03-25T12:00:00Z");

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

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript ISO Dates</h2>
<p>Separate date and time with a capital T.</p>
<p>Indicate UTC time with a capital Z.</p>

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

<script>
const d = new Date("2015-03-25T12:00:00Z");
document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>

.ﺖﺳﺍ ﻩﺪﺷ ﺍﺪﺟ ﻢﻫ ﺯﺍ ﮒﺭﺰﺑ T ﺎﺑ ﻥﺎﻣﺯ ﻭ ﺦﯾﺭﺎﺗ

.ﺩﻮﺷ ﯽﻣ ﻒﯾﺮﻌﺗ Z ﮒﺭﺰﺑ ﻑﺮﺣ ﺎﺑ UTC ﻥﺎﻣﺯ

.ﺪﯿﻨﮐ ﻪﻓﺎﺿﺍ ﺍﺭ HH:MM- ﺎﯾ HH:MM+ ﻭ ﺪﯿﻨﮐ ﻑﺬﺣ ﺍﺭ Z ،ﺪﯿﻫﺩ ﺮﯿﯿﻐﺗ UTC ﻪﺑ ﺖﺒﺴﻧ ﺍﺭ ﻥﺎﻣﺯ ﺪﯿﻫﺍﻮ

ﻝﺎﺜﻣ

const d = new Date("2015-03-25T12:00:00-06:30");

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

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript ISO Dates</h2>
<p>Modify the time relative to UTC by adding +HH:MM or subtraction -HH:MM to the time.</p>

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

<script>
document.getElementById("demo").innerHTML =
new Date("2015-03-25T12:00:00-06:00");
</script>

</body>
</html>

UTC (ﯽﻧﺎﻬﺟ ﮓﻨﻫﺎﻤﻫ ﻥﺎﻣﺯ) ﻥﺎﻤﻫ GMT (ﭻﯾﻮﻨﯾﺮﮔ ﻥﺎﻣﺯ) ﺖﺳﺍ.

.ﺪﺷﺎﺑ ﻪﺘﺷﺍﺩ ﻒﻠﺘﺨﻣ ﯼﺎﻫﺮﮔﺭﻭﺮﻣ ﺭﺩ ﯽﺗﻭﺎﻔﺘﻣ ﺞﯾﺎﺘﻧ ﺪﻧﺍﻮﺗ ﯽﻣ ﻥﺎﻣﺯ-ﺦﯾﺭﺎﺗ ﻪﺘﺷﺭ ﺭﺩ Z ﺎﯾ T ﻑﺬﺣ


ﯽﻧﺎﻣﺯ ﯼﺎﻫ ﻩﺩﻭﺪﺤﻣ

ﺩﺮﮐ ﺪﻫﺍﻮﺧ ﻩﺩﺎﻔﺘﺳﺍ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ،ﯽﻧﺎﻣﺯ ﻪﻘﻄﻨﻣ ﻦﯿﯿﻌﺗ ﻥﻭﺪﺑ ،ﺦﯾﺭﺎﺗ ﻢﯿﻈﻨﺗ ﻡﺎﮕﻨﻫ

ﺪﯾﺁ ﯽﻣ ﺖﺳﺩ ﻪﺑ ﻪﺠﯿﺘﻧ ،ﯽﻧﺎﻣﺯ ﻪﻘﻄﻨﻣ ﻦﯿﯿﻌﺗ ﻥﻭﺪﺑ ،ﺦﯾﺭﺎﺗ ﺖﻓﺎﯾﺭﺩ ﻡﺎﮕﻨﻫ

،ﺩﻮﺷ ﺩﺎﺠﯾﺍ (ﭻﯾﻮﻨﯾﺮﮔ ﻥﺎﻣﺯ) GMT ﺭﺩ ﻥﺎﻣﺯ/ﺦﯾﺭﺎﺗ ﺮﮔﺍ :ﺮﮕﯾﺩ ﺕﺭﺎﺒﻋ ﻪﺑ


ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﻩﺎﺗﻮﮐ ﯼﺎﻫ ﺦﯾﺭﺎﺗ

:ﺪﻧﻮﺷ ﯽﻣ ﻪﺘﺷﻮﻧ ﻦﯾﺍ ﺪﻨﻧﺎﻣ "MM/DD/YYYY" ﺭﻮﺘﺳﺩ ﺎﺑ ﻩﺎﺗﻮﮐ ﯼﺎﻫ ﺦﯾﺭﺎﺗ

ﻝﺎﺜﻣ

const d = new Date("03/25/2015");

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

<!DOCTYPE html>
<html>
<body>

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

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

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

</body>
</html>

!ﺎﻫﺭﺍﺪﺸﻫ

:ﺪﻨﻨﮐ ﺩﺎﺠﯾﺍ ﺎﻄﺧ ﮏﯾ ﺖﺳﺍ ﻦﮑﻤﻣ ﻝﻭﺍ ﺮﻔﺻ ﻥﻭﺪﺑ ﺎﻫﺯﻭﺭ ﺎﯾ ﺎﻫ ﻩﺎﻣ ،ﺎﻫﺮﮔﺭﻭﺮﻣ ﺯﺍ ﯽﺧﺮﺑ ﺭﺩ

const d = new Date("2015-3-25");

ﺎﻫﺮﮔﺭﻭﺮﻣ ﺯﺍ ﯽﺧﺮﺑ
.ﺖﺳﺍ ﻩﺪﺸﻧ ﻒﯾﺮﻌﺗ "YYYY/MM/DD" ﺭﺎﺘﻓﺭ

const d = new Date("2015/03/25");

ﺎﻫﺮﮔﺭﻭﺮﻣ ﯽﺧﺮﺑ
.ﺖﺳﺍ ﻩﺪﺸﻧ ﻒﯾﺮﻌﺗ ﺰﯿﻧ «DD-MM-YYYY» ﺭﺎﺘﻓﺭ

const d = new Date("25-03-2015");

.ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﯽﻧﻻﻮﻃ ﯼﺎﻫ ﺦﯾﺭﺎﺗ

:ﺪﻧﻮﺷ ﯽﻣ ﻪﺘﺷﻮﻧ ﻦﯾﺍ ﺪﻨﻧﺎﻣ "MMM DD YYYY" ﺭﻮﺘﺳﺩ ﺎﺑ ﺐﻠﻏﺍ ﯽﻧﻻﻮﻃ ﯼﺎﻫ ﺦﯾﺭﺎﺗ

ﻝﺎﺜﻣ

const d = new Date("Mar 25 2015");

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

<!DOCTYPE html>
<html>
<body>

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

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

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

</body>
</html>

:ﺪﺷﺎﺑ ﯽﺒﯿﺗﺮﺗ ﺮﻫ ﻪﺑ ﺪﻧﺍﻮﺗ ﯽﻣ ﺯﻭﺭ ﻭ ﻩﺎﻣ

ﻝﺎﺜﻣ

const d = new Date("25 Mar 2015");

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

<!DOCTYPE html>
<html>
<body>

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

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

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

</body>
</html>

:ﺖﺷﻮﻧ (ﻥﺍﮊ) ﺭﺎﺼﺘﺧﺍ ﻪﺑ ﺎﯾ (ﻪﯾﻮﻧﺍﮊ) ﻞﻣﺎﮐ ﺭﻮﻃ ﻪﺑ ﻥﺍﻮﺗ ﯽﻣ ﺍﺭ ﻩﺎﻣ ﻭ

ﻝﺎﺜﻣ

const d = new Date("January 25 2015");

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

<!DOCTYPE html>
<html>
<body>

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

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

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

</body>
</html>

ﻝﺎﺜﻣ

const d = new Date("Jan 25 2015");

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

<!DOCTYPE html>
<html>
<body>

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

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

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

</body>
</html>

:ﺪﻨﺘﺴﻫ ﮏﭼﻮﮐ ﻭ ﮒﺭﺰﺑ ﻑﻭﺮﺣ ﻥﻭﺪﺑ ﺎﻫ ﻡﺎﻧ .ﺩﻮﺷ ﯽﻣ ﻪﺘﻓﺮﮔ ﻩﺪﯾﺩﺎﻧ ﺎﻣﺎﮐ

ﻝﺎﺜﻣ

const d = new Date("JANUARY, 25, 2015");

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

<!DOCTYPE html>
<html>
<body>

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

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

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

</body>
</html>

ﺎﻬﺨﯾﺭﺎﺗ ﻪﯾﺰﺠﺗ - ﺦﯾﺭﺎﺗ ﯼﺩﻭﺭﻭ

ﺪﯿﻨﮐ ﻩﺩﺎﻔﺘﺳﺍ <"code class="w3-codespan> ﺯﺍ ﺪﯿﻧﺍﻮﺗ ﯽﻣ ،ﺪﯾﺭﺍﺩ ﺮﺒﺘﻌﻣ ﺦﯾﺭﺎﺗ ﻪﺘﺷﺭ ﮏﯾ ﺮﮔﺍ

Date.parse() ﯽﻣﺮﺑ ﺍﺭ ﻪﯾﻮﻧﺍﮊ ﻭ ﺦﯾﺭﺎﺗ ﻦﯿﺑ ﻪﯿﻧﺎﺛ ﯽﻠﯿﻣ ﺩ

ﻝﺎﺜﻣ

let msec = Date.parse("March 21, 2012");

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

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript Date.parse()</h2>
<p>Date.parse() returns the number of milliseconds between the date and January 1, 1970:</p>

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

<script>
const msec = Date.parse("March 21, 2012");
document.getElementById("demo").innerHTML = msec;
</script>

</body>
</html>

:ﺪﯿﻨﮐ ﻩﺩﺎﻔﺘﺳﺍ ﺦﯾﺭﺎﺗ ءﯽﺷ ﮏﯾ ﻪﺑ ﻥﺁ ﻞﯾﺪﺒﺗ ﯼﺍﺮﺑ ﻪﯿﻧﺎﺛ ﯽﻠﯿﻣ ﺩﺍﺪﻌﺗ ﺯﺍ ﺪﯿﻧﺍ

ﻝﺎﺜﻣ

let msec = Date.parse("March 21, 2012");
const d = new Date(msec);

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

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript Date.parse()</h2>
<p>Date.parse(string) returns milliseconds.</p>
<p>You can use the return value to convert the string to a date object:</p>

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

<script>
let msec = Date.parse("March 21, 2012");
const d = new Date(msec);
document.getElementById("demo").innerHTML = d;
</script>

</body>
</html>

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

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

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

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

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