Date Object: Date & Time In JavaScript | JavaScript Full Course for Beginners | Parnika Tutorials
Parnika Tutorials Parnika Tutorials
22.5K subscribers
95 views
5

 Published On May 8, 2023

In this video, we'll be exploring the functions in JavaScript. We'll be looking at the how to define a function and call a function.

By the end of this video, you'll have a better understanding of how functions work and be able to use them to make your code more readable and easy to understand.
#javascript #parnikatutorials #functions #html #css #webdesigning

Social media Links:
Instagram:   / parnikatutorials  
Website: http://parnikatutorials.in/
Email id: [email protected]
To get the regular updates:
Telegram link: https://t.me/Parnikatutorials
Facebook: https://m.facebook.com/profile.php?id...
Linkedin:   / parnika-tutorials-a8a9831b2  
Pinterest:   / parnikatutorials0892  
Playlists:
Virtual Coffee with Jagadeesh:
   • VIRTUAL COFFEE WITH JAGADEESH  
Digital Logic Design:
   • Digital Logic Design  
Computer Organization and Architecture:
   • ABOUT PARNIKA TUTORIALS  
C Programming:
   • L 1: WHAT IS AN ALGORITHM AND CHARACT...  
Data Structures:
   • L 1: Uncover the Benefits of Linked L...  

Theory of Computation:
   • ABOUT PARNIKA TUTORIALS  

Compiler Design:
   • ABOUT PARNIKA TUTORIALS  
Operating Systems:    • PROCESS STATE DIAGRAM | LONG TERM, SH...  

Databases:    • ABOUT PARNIKA TUTORIALS  

Computer Networks:
   • ABOUT PARNIKA TUTORIALS  
For GATE PYQs and much more explore:
   / parnikatutorials  


The JavaScript date object can be used to get year, month and day. You can display a timer on the webpage by the help of JavaScript date object.

You can use different Date constructors to create date object. It provides methods to get and set day, month, year, hour, minute and seconds.
Constructor

You can use 4 variant of Date constructor to create date object.

Date()
Date(milliseconds)
Date(dateString)
Date(year, month, day, hours, minutes, seconds, milliseconds)

JavaScript Date Methods

Let's see the list of JavaScript date methods with their description.

getDate() It returns the integer value between 1 and 31 that represents the day for the specified date on the basis of local time.
getDay() It returns the integer value between 0 and 6 that represents the day of the week on the basis of local time.
getFullYears() It returns the integer value that represents the year on the basis of local time.
getHours() It returns the integer value between 0 and 23 that represents the hours on the basis of local time.
getMilliseconds() It returns the integer value between 0 and 999 that represents the milliseconds on the basis of local time.
getMinutes() It returns the integer value between 0 and 59 that represents the minutes on the basis of local time.
getMonth() It returns the integer value between 0 and 11 that represents the month on the basis of local time.
getSeconds() It returns the integer value between 0 and 60 that represents the seconds on the basis of local time.

setDate() It sets the day value for the specified date on the basis of local time.
setDay() It sets the particular day of the week on the basis of local time.
setFullYears() It sets the year value for the specified date on the basis of local time.
setHours() It sets the hour value for the specified date on the basis of local time.
setMilliseconds() It sets the millisecond value for the specified date on the basis of local time.
setMinutes() It sets the minute value for the specified date on the basis of local time.
setMonth() It sets the month value for the specified date on the basis of local time.
setSeconds() It sets the second value for the specified date on the basis of local time.

show more

Share/Embed