Brief: string-to-date function
The date passed in a string format, and how to convert it to a date type. The following is a conversion scenario.
The string is converted to a date function, returning the date type (incoming date format 2014-04-22) function stringtodate (str) {var strdate = Str.split (""); var Strdatepart = Strdate[0].split ("-"); var dtdate = new Date (strdatepart[0],strdatepart[1]-1,strdatepart[2]); return dtdate;}
If you think reading this blog gives you something to gain, you might want to click " recommend " in the lower right corner.
If you want to find my new blog more easily, click on " Follow me "
If you want to give me more encouragement, you may wish to click on the right, " enjoy your stay"
Blog is his own summary of the results of learning, learning to summarize the knowledge-"analysis of the problem-" to solve the problem.
Where the views/descriptions in the text are incorrect, please correct them.
Thank you for your reading, if you are interested in the content of my blog, please continue to follow my following blog, I am yxtic.
string conversion to date type in JS