Day of the week: Difference between revisions

→‎{{header|J}}: simpler, faster
(→‎{{header|J}}: simpler, faster)
Line 731:
 
=={{header|J}}==
<lang j> load 'dates' NB. provides verb 'weekday'
SunDec25xmasSunday=: #~ 0& =@ [: weekday@:(|:@,: 12 25 ,~"1 0 ] NB. 12returns years where 25$~#,2:) Dec is a Sunday
xmasSunday 2008 + i.114 NB. check years from 2008 to 2121
SunDec25 2008 + i.114
2011 2016 2022 2033 2039 2044 2050 2061 2067 2072 2078 2089 2095 2101 2107 2112 2118</lang>
 
892

edits