p5.js | month() function
The month() function in p5.js is used to get the current month from the system’s clock.
Syntax
month()
Parameters: The function does not accept any parameter.
Below program illustrates the month() function in p5.js:
Example :
function setup() { //create Canvas of size 270*80 createCanvas(270, 80); } function draw() { background(220); //initialize the parameter with month let m = month(); textSize(16); fill(color('red')); text("Current Month is : " + m, 50, 30); } |
chevron_right
filter_none
Output:

Reference: https://p5js.org/reference/#/p5/month
Recommended Posts:
- How to convert number to month name in PHP?
- How to get the day and month of a year using JavaScript ?
- HTML | DOM Input Month Object
- HTML | DOM Input Month name Property
- HTML | DOM Input Month max Property
- How to get the first and last date of current month using JavaScript ?
- How to get the number of days in a specified month using JavaScript ?
- HTML | DOM Input Month min Property
- HTML | DOM Input Month value Property
- HTML | <input type="month">
- How to get Month and Date of JavaScript in two digit format ?
- HTML | DOM Input Month disabled Property
- HTML | DOM Input Month stepUp() Method
- HTML | DOM Input Month stepDown() Method
- HTML | DOM Input Month step Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



