Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

What's the date, in Usenet time?

September 1993 is known on Usenet as the September that never ended. Thus, for example, the day this question is being posted is Saturday, September 8740, 1993.

Your program or function should take any Gregorian date (with positive year) as input and return the same date as output if it's prior to September 1993 or the date on the September 1993 calendar if thereafter.

You may accept YYYY-MM-DD, YYYY/MM/DD, MM/DD/YYYY, DD/MM/YYYY, D-Monthnameabbr-YYYY, or any other popular format that uses the entirety of the year (as opposed to the year modulo 100). You need only accept one such format, of your choosing. Output format must match the input format.

Sample input → output:

  • Sunday, 6 August 2017 → Sunday, 8741 September 1993
  • Tuesday, 28 January 1986 → Tuesday, 28 January 1986

Or:

  • 2017年08月06日 → 1993-09-8741
  • 1986年01月28日 → 1986年01月28日

In the interest of more interesting answers, the use of a built-in function designed for this purpose (such as the UN*X sdate command) is disallowed. Aside from that and the standard exceptions, this is golf, so the shortest answer wins.

Answer*

Draft saved
Draft discarded
Cancel

AltStyle によって変換されたページ (->オリジナル) /