Movatterモバイル変換


[0]ホーム

URL:


Menu
×
See More 
Sign In
+1 Get Certified Upgrade For Teachers Spaces Get Certified Upgrade For Teachers Spaces
   ❮     
     ❯   

JS Reference

JS by CategoryJS by Alphabet

JavaScript

JS ArraysJS BooleanJS ClassesJS DatesJS ErrorJS GlobalJS IteratorsJS JSONJS MapsJS MathJS NumbersJS ObjectsJS OperatorsJS AssignmentJS ArithmeticJS ComparisonJS Logical OperatorsJS Bitwise OperatorsJS Misc OperatorsJS PrecedenceJS PromisesJS ProxyJS ReflectJS RegExp PatternsJS RegExp ReferenceJS SetsJS StatementsJS StringsJS Typed ArraysJS Typed Reference

Window

Window ObjectWindow ConsoleWindow HistoryWindow LocationWindow NavigatorWindow Screen

HTML DOM

HTML DocumentsHTML Elements
accessKeyaddEventListener()after()append()appendChild()attributesbefore()blur()childElementCountchildNodeschildrenclassListclassNameclick()clientHeightclientLeftclientTopclientWidthcloneNode()closest()compareDocumentPosition()contains()contentEditabledirfirstChildfirstElementChildfocus()getAttribute()getAttributeNode()getBoundingClientRect()getElementsByClassName()getElementsByTagName()hasAttribute()hasAttributes()hasChildNodes()idinnerHTMLinnerTextinsertAdjacentElement()insertAdjacentHTML()insertAdjacentText()insertBefore()isContentEditableisDefaultNamespace()isEqualNode()isSameNode()isSupported()langlastChildlastElementChildmatches()namespaceURInextSiblingnextElementSiblingnodeNamenodeTypenodeValuenormalize()offsetHeightoffsetWidthoffsetLeftoffsetParentoffsetTopouterHTMLouterTextownerDocumentparentNodeparentElementpreviousSiblingpreviousElementSiblingquerySelector()querySelectorAll()remove()removeAttribute()removeAttributeNode()removeChild()removeEventListener()replaceChild()scrollHeightscrollIntoView()scrollLeftscrollTopscrollWidthsetAttribute()setAttributeNode()styletabIndextagNametextContenttitle
HTML AttributesHTML CollectionHTML NodeListHTML DOMTokenListHTML Styles
alignContentalignItemsalignSelfanimationanimationDelayanimationDirectionanimationDurationanimationFillModeanimationIterationCountanimationNameanimationTimingFunctionanimationPlayStatebackgroundbackgroundAttachmentbackgroundClipbackgroundColorbackgroundImagebackgroundOriginbackgroundPositionbackgroundRepeatbackgroundSizebackfaceVisibilityborderborderBottomborderBottomColorborderBottomLeftRadiusborderBottomRightRadiusborderBottomStyleborderBottomWidthborderCollapseborderColorborderImageborderImageOutsetborderImageRepeatborderImageSliceborderImageSourceborderImageWidthborderLeftborderLeftColorborderLeftStyleborderLeftWidthborderRadiusborderRightborderRightColorborderRightStyleborderRightWidthborderSpacingborderStyleborderTopborderTopColorborderTopLeftRadiusborderTopRightRadiusborderTopStyleborderTopWidthborderWidthbottomboxShadowboxSizingcaptionSidecaretColorclearclipcolorcolumnCountcolumnFillcolumnGapcolumnRulecolumnRuleColorcolumnRuleStylecolumnRuleWidthcolumnscolumnSpancolumnWidthcounterIncrementcounterResetcssFloatcursordirectiondisplayemptyCellsfilterflexflexBasisflexDirectionflexFlowflexGrowflexShrinkflexWrapfontfontFamilyfontSizefontStylefontVariantfontWeightfontSizeAdjustheightisolationjustifyContentleftletterSpacinglineHeightlistStylelistStyleImagelistStylePositionlistStyleTypemarginmarginBottommarginLeftmarginRightmarginTopmaxHeightmaxWidthminHeightminWidthobjectFitobjectPositionopacityorderorphansoutlineoutlineColoroutlineOffsetoutlineStyleoutlineWidthoverflowoverflowXoverflowYpaddingpaddingBottompaddingLeftpaddingRightpaddingToppageBreakAfterpageBreakBeforepageBreakInsideperspectiveperspectiveOriginpositionquotesresizerightscrollBehaviortableLayouttabSizetextAligntextAlignLasttextDecorationtextDecorationColortextDecorationLinetextDecorationStyletextIndenttextOverflowtextShadowtextTransformtoptransformtransformOrigintransformStyletransitiontransitionPropertytransitionDurationtransitionTimingFunctiontransitionDelayunicodeBidiuserSelectverticalAlignvisibilitywidthwordBreakwordSpacingwordWrapwidowszIndex

HTML Events

HTML EventsHTML Event ObjectsHTML Event PropertiesHTML Event Methods

Web APIs

API CanvasAPI ConsoleAPI FetchAPI FullscreenAPI GeolocationAPI HistoryAPI MediaQueryListAPI StorageAPI ValidationAPI Web

HTML Objects

<a><abbr><address><area><article><aside><audio><b><base><bdo><blockquote><body><br><button><canvas><caption><cite><code><col><colgroup><datalist><dd><del><details><dfn><dialog><div><dl><dt><em><embed><fieldset><figcaption><figure><footer><form><head><header><h1> - <h6><hr><html><i><iframe><img><ins><input> button<input> checkbox<input> color<input> date<input> datetime<input> datetime-local<input> email<input> file<input> hidden<input> image<input> month<input> number<input> password<input> radio<input> range<input> reset<input> search<input> submit<input> text<input> time<input> url<input> week<kbd><label><legend><li><link><map><mark><menu><menuitem><meta><meter><nav><object><ol><optgroup><option><output><p><param><pre><progress><q><s><samp><script><section><select><small><source><span><strong><style><sub><summary><sup><table><tbody><td><tfoot><th><thead><tr><textarea><time><title><track><u><ul><var><video>

Other References

CSSStyleDeclarationJS Conversion


JavaScript Date setUTCMonth()

Example

Set the month to 4 (May):

const d = new Date("2025-01-15");
d.setUTCMonth(4);
Try it Yourself »

More "Try it Yourself" examples below.


Description

ThesetUTCMonth() method sets the month (from 0 to 11) of a date object, according to UTC.

Note: January is 0, February is 1, and so on.

Notes

UTC (Universal Time Coordinated) is the time set by the World Time Standard.

UTC time is the same as GMT time (Greenwich Mean Time).


Syntax

Date.setUTCMonth(month, day)

Parameter Values

ParameterDescription
monthRequired. An integer representing the month

Expected values are 0-11, but other values are allowed:

  • -1 will result in the last month of the previous year
  • 12 will result in the first month of the next year
  • 13 will result in the second month of the next year
dayOptional. An integer representing the day of month

Expected values are 1-31, but other values are allowed:

  • 0 will result in the last hour of the previous month
  • -1 will result in the hour before the last hour of the previous month

If the month has 31 days:

  • 32 will result in the first day of the next month

If the month has 30 days:

  • 32 will result in the second day of the next month

Return Value

NONE

Changes the Date object in place.



More Examples

Example

Set the month to 4 (May) and the day to the 20th:

const d = new Date("2025-01-15");
d.setUTCMonth(4, 20);
Try it Yourself »

Example

Set the date to be the last day of last month:

const d = new Date("2025-01-15");
d.setUTCMonth(d.getUTCMonth(), 0);
Try it Yourself »

Browser Support

setUTCMonth() is an ECMAScript1 (JavaScript 1997) feature.

It is supported in all browsers:

ChromeEdgeFirefoxSafariOpera


×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning.
Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness
of all content. While using W3Schools, you agree to have read and accepted ourterms of use,cookies andprivacy policy.

Copyright 1999-2025 by Refsnes Data. All Rights Reserved.W3Schools is Powered by W3.CSS.


[8]ページ先頭

©2009-2025 Movatter.jp