Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How does js get the system time, year, month, day, hour and minute?
How does js get the system time, year, month, day, hour and minute?
Time stamp to time, simple alarm ((newdate ("1412849746")). tolocaledatestring())

date . set date(date . getdate()+60); //60 Here is the number of days you want to add or subtract. The year and month will be added accordingly. It is worth noting that the month obtained by date.getMonth () is less than the actual month 1, so the actual month is (date.getMonth()+ 1)?

Its getMilliSeconds is also to get the milliseconds of the current time. So we need to make our own changes. You can use getMinutes and getSeconds to get the corresponding minutes and seconds, and then convert the minutes into *60* 1000+ seconds * 1000.