My answer is based on @eldo's and @ubpdqn's answer (thanks guys!). Remove // Flatten[#, 1] &
to get the dates grouped into years.
Clear[seismaticaDates]
seismaticaDates[year_,{mfrom_,dfrom_},{mto_,dto_},{cy_,cm_,cd_}]:=
Module[{dateRangeFunc,allDates},
dateRangeFunc=DateRange[{#,mfrom,dfrom},{#,mto,dto}]&;
(* Defining 2 allDates functions to prevent counting days
when the date of the current year hasn't reached the starting date of the interval
i.e. take the "nearest past summer" *)
allDates[{y_,m_,d_}/;m<mfrom||m==mfrom&&d<dfrom]:=dateRangeFunc/@Range[year,y-1];
allDates[{y_,m_,d_}]:=dateRangeFunc/@Range[year,y];
DeleteCases[allDates[{cy,cm,cd}],{cy,m_,d_}/;m>cm||(m==cm&&d>cd),{2}]//Flatten[#,1]&]
seismaticaDates[1970,{7,4},{10,4},Take[Normal@Today,3]]
{{1970,7,4},{1970,7,5},{1970,7,6},{1970,7,7},{1970,7,8},{1970,7,9},{1970,7,10},{1970,7,11},{1970,7,12},{1970,7,13},{1970,7,14},{1970,7,15},{1970,7,16},{1970,7,17}, ...4096... ,{2014,7,22},{2014,7,23},{2014,7,24},{2014,7,25},{2014,7,26},{2014,7,27},{2014,7,28},{2014,7,29},{2014,7,30},{2014,7,31},{2014,8,1},{2014,8,2},{2014,8,3},{2014,8,4}}
seismaticaDates[1970,{7,4},{10,4},{2015,1,3}]
{{1970,7,4},{1970,7,5},{1970,7,6},{1970,7,7},{1970,7,8},{1970,7,9},{1970,7,10},{1970,7,11},{1970,7,12},{1970,7,13},{1970,7,14},{1970,7,15},{1970,7,16},{1970,7,17}, ...4157... ,{2014,9,21},{2014,9,22},{2014,9,23},{2014,9,24},{2014,9,25},{2014,9,26},{2014,9,27},{2014,9,28},{2014,9,29},{2014,9,30},{2014,10,1},{2014,10,2},{2014,10,3},{2014,10,4}}
Comparison with @eldo's method
My method seems to not require any Internet connection (as compared to @eldo's method), and it seems to run faster as well.
eldoDates=Module[{td,cy,cm,cd,days},
td=Today//Normal;
{cy,cm,cd}=Take[td,3];
days=Flatten[DateRange[{#,7,4},{#,10,4},"Day"]&/@Range[1970,cy],1];
Which[Today>Interpreter["Date"]["04/October/"<>ToString@cy],days,Today<Interpreter["Date"]["04/July/"<>ToString@cy],DeleteCases[days,{cy,__}],True,DeleteCases[days,{y_,m_,d_}/;y==cy&&m>cm||y==cy&&m==cm&&d>cd]]]//AbsoluteTiming;
s1=seismaticaDates[1970,{7,4},{10,4},Take[Normal@Today,3]]//AbsoluteTiming;
First/@{s1,eldoDates}
(* {0.069004,0.776044} *)
Equal[Rest@s1, Rest@eldoDates]
(* True *)
Flatten[DateRange[{#, 7, 4}, {#, 10, 4}, "Day"] & /@ Range[1974, 2013], 1]
? $\endgroup$