Date object of js

Date object

  • Use Date in JS to represent a time

  • If you use the constructor directly to create a Date object, it will be encapsulated as the execution time of the current code

  • getDate()Get the current object is a few days

  • getDay() gets the day of the week of the current object, and returns a value of 0-6, 0 means Sunday

  • getMonth() gets the month of the current object, it will return a value of 0-11, 0 means January

  • getFullYear() Get the year of the current object

  • getTime() Gets the timestamp of the current object. The timestamp
    refers to the
    number of milliseconds that it took from 0:0:0 to the current date on January 1, 1970, Greenwich Mean Time (1 second = 1000 milliseconds)

    • The bottom layer of the computer uses timestamps when saving time

Insert picture description here
Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_48769418/article/details/110312241