When running the program must show the season according to the host computer's current time.


  • The output must be either: Spring, Winter, Summer or Autumn.

  • The capitalization does not matter.

  • The output must not contain anything else the the season names stated above.

  • A season is 3 months and january is in this case the start of spring. (Northern hemisphere)


(program ran in January)



(program ran in April)




This is . Shortest answer in bytes wins.

  • \$\begingroup\$ Can we return one of 0, 1, 2, 3 instead of Spring, Winter, Summer, Autumn? \$\endgroup\$
    – Stephen
    Commented May 20, 2017 at 16:59
  • 9
    \$\begingroup\$ What ranges of dates are in each season? \$\endgroup\$ Commented May 20, 2017 at 16:59
  • \$\begingroup\$ And in mine, spring starts from march \$\endgroup\$
    – Mr. Xcoder
    Commented May 20, 2017 at 17:45
  • \$\begingroup\$ What if I live in the Southern Hemisphere? \$\endgroup\$
    – Ian Miller
    Commented May 21, 2017 at 15:59
  • \$\begingroup\$ @IanMiller do you have other seasons there? for this challenge you need to output the season as in january is the start of spring december is the end of winter etc \$\endgroup\$
    – Luc H
    Commented May 21, 2017 at 17:37

3 Answers 3


Jelly, 40 bytes


Jelly has no native date functionality, yet this program prints Spring in January, February and March; Summer in April, May and June; Autumn in July, August, and September; and Winter in October, November and December.

Try it online!


“¡ɗNʂ:ḲO¶Z{ṅ{Ḳ®⁵⁹¢»ŒV’:3ị“ȷ14ċ⁵¶<b_þṭ»Ḳ¤ - Main link: no arguments
“¡ɗNʂ:ḲO¶Z{ṅ{Ḳ®⁵⁹¢»                      - compressed string: " time.gmtime().tm_mon"
                   ŒV                    - evaluate Python code - gets the month, January=1 ... December=12 (the time module has been imported in the interpreter for the time formatting atom ŒT)
                     ’                   - decrement
                     :3                  - integer divide by three
                                       ¤ - nilad followed by link(s) as a nilad:
                         “ȷ14ċ⁵¶<b_þṭ»   - compressed string "Summer Autumn Winter Spring"
                                      Ḳ  - split on spaces
                        ị                - index into (1-based)
                                         - implicit print
  • \$\begingroup\$ That is stupidly clever. Take a +1. \$\endgroup\$ Commented May 22, 2017 at 18:32

05AB1E, 25 16 bytes



“Ž¹Ž€È±–„“        Push the string 'spring summer autumn winter'
          #       Split on spaces
           žf     Push month
             3÷   Integer divided by 3
               è  Index

Try it online!


Japt, 32 30 27 bytes

`spÎAdä>H©umØC`qd gKg z3

Try it online


A compressed string of lowercase, separated season names delimited with d is decompressed by enclosing it in backticks. qd splits the string into an array on ds. The g method gets the element at the index of the current month (Kg) floor divided by 3 (z3).


Not the answer you're looking for? Browse other questions tagged or ask your own question.