Skip to content

Commit

Permalink
Clarify that Date.p.setDate() uses local time (#3172)
Browse files Browse the repository at this point in the history
Fixes #2833
  • Loading branch information
sideshowbarker committed Mar 16, 2021
1 parent bcdf1ae commit 0a67569
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
---
<div>{{JSRef}}</div>

<p>The <strong><code>setDate()</code></strong> method sets the day of the
{{jsxref("Date")}} object relative to the beginning of the currently set month.</p>
<p>The <strong><code>setDate()</code></strong> method changes the day of the month of a given {{jsxref("Date")}} instance, based on local time.</p>

<p>To instead change the day of the month for a given {{jsxref("Date")}} instance based on UTC time, use the {{jsxref("Date.prototype.setUTCDate()", "setUTCDate()")}} method.</p>

<div>{{EmbedInteractiveExample("pages/js/date-setdate.html")}}</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
---
<div>{{JSRef}}</div>

<p>The <strong><code>setUTCDate()</code></strong> method sets the day of the month for a
specified date according to universal time.</p>
<p>The <strong><code>setUTCDate()</code></strong> method changes the day of the month of a given {{jsxref("Date")}} instance, based on UTC time.</p>

<p>To instead change the day of the month for a given {{jsxref("Date")}} instance based on local time, use the {{jsxref("Date.prototype.setDate()", "setDate()")}} method.</p>

<div>{{EmbedInteractiveExample("pages/js/date-setutcdate.html")}}</div>

Expand Down

0 comments on commit 0a67569

Please sign in to comment.