This is a noob question:
How to parse a date in format "YYYYmmdd" without external libraries ? If the input string is not in this format I would like to get invalid Date (or undefined if it will be easier).
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Usage:
UPDATE:
As Rocket said, months are 0-based in js…use this if month’s aren’t 0-based in your string
UPDATE:
More rigorous checking for validity of date. Adopted HBP’s way to validate date.