1
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
9
Please avoid creating new tags unless they're really missing. We already have
– Arnauld – 2019-12-13T10:27:41.697date
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
?10I suggest removing The date will be stored in a string called
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. – Adám – 2019-12-13T10:31:15.8131Do you mean the output should be stored in
s
, or that the input would be stored ins
? – Kobe – 2019-12-13T11:00:17.8001
@Arnauld There was discussion around that topic (a "beginner" or "easy" tag) quite a while ago with no clear consensus. IMO that's still the case because it's very subjective.
– AdmBorkBork – 2019-12-13T14:40:57.940Within a day of posting this, 5 people flocked to close it as off-topic because it didn't contain an objective primary winning criterion. I thought "the least characters" was the default winning criterion? Isn't it quite petty to shut this down like that? – ToonAlfrink – 2019-12-19T14:26:28.503
1I'd say, the newly-added
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 – Shieru Asakoto – 2019-12-20T01:19:09.063