Simple question!
Given a string that contains a date in ISO8601 format, print the first of the next month in ISO8601 format.
Example inputs:
2018-05-06
2019-12-20
Their respective outputs:
2018-06-01
2020-01-01
The rules:
- Imports are free and don't count towards your score.
- The date will be stored in a string called
s
. - The solution with the least characters, wins
date
andparsing
. Thebeginner
tag is an interesting idea, but I think that should be discussed in meta. On the other hand, you must include a tag telling what's the winning criterion. Is thiscode-golf
? \$\endgroup\$s
. and leave it up to the answerers to use any of the default I/O methods. Btw, reading from a pre-defined variable is not among those defaults. Also, not all languages have strings, and not all languages have variables. \$\endgroup\$s
, or that the input would be stored ins
? \$\endgroup\$The solution with the least characters, wins
could count as the winning criteria, but we prefer not to specify a variable that the input/output have to be stored inside \$\endgroup\$