Front-end date question

(Beijing time zone area is set when serverTimezone = GMT% 2B8, configure the connection to the database statement) 2, the date of creation of the late 8 hours

spring.datasource.url=jdbc:mysql://localhost:3306/my_project?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&useSSL=false

1, creation date

var date = new Date()(首先设置一个新的时间)

var year = date.getFullYear()(获取当前的年份,例如现在是2019年)

var month = date.getMonth();(获取当前的月份,现在是十月,北京可真冷啊)
Published 63 original articles · won praise 1 · views 2660

Guess you like

Origin blog.csdn.net/qq_42039738/article/details/104615412