Javascript Date Types and Functions

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/javascript-date-types-functions/
PINTEREST
PINTEREST
INSTAGRAM

Date is used to store date related types. There are a lot of date functions to operate with date variables. Date holds year,month,day,hour,minute,second and millisecond.

  • We have created new d variable with date type.

  • This is the value holded 

Get Day of Week

The day number of the week can be get with getDay()

  • getDay() will return the number of the day of week. For example if it is monday it will return 1

Get Hour

We can get hour but not minute with getHours()

  • getHours() will return 6 if the time is 6:45

Get Minute

We can get minute with getMinutes()

  • getMinutes() will return 45 if the time is 6:45

Get Second

We can get second with getSeconds()

  • getSeconds() will return 55 if the time is 6:45:55

Get Year

We can get year with getYear()

  • getYear() will return 2016

Get Second

We can get second with getSeconds()

  • getSeconds() will return 55 if the hour is 6:45:55
RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/javascript-date-types-functions/
PINTEREST
PINTEREST
INSTAGRAM

LEARN MORE  Windows Configuration Tools Command Line Shortcuts

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)