This article is a mirror article of machine translation, please click here to jump to the original article.

View: 13530|Reply: 0

[JavaScript] js string to date and date plus day

[Copy link]
Posted on 10/12/2017 1:50:30 PM | | | |
js string date code:



js converts strings to dates The reference code is as follows:
var s ='2017-04-18 09:16:15';
s = s.replace(/-/g,"/");
var date = new Date(s );
Explanation:
/-/g 是正则表达式
Indicates that all short horizontal lines - replace with slashes/
where g represents global substitution


JS appends one day to the current date




The effect is as follows:






Previous:Linq: Never use Count() > 0 to determine that the set is non-empty
Next:Tutorial on obtaining root permissions
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com