evaluating code from post

In[]:=
AstroPosition
Sun
STAR
,"Equatorial"["Declination"]
Out[]=
13.56
In[]:=
NumberForm[13.56,16]
Out[]//NumberForm=
13.55997680699307
In[]:=
sunDeclination//ClearAll​​sunDeclination[date_?DateObjectQ]:=AstroPosition
Sun
STAR
,{"Equatorial",date}["Declination"]
In[]:=
DateListPlotTable{date,sunDeclination[date]},date,DateRange
Sat 1 Jan 2022
,
Sun 1 Jan 2023

Out[]=
In[]:=
FindMinimum[sunDeclination[DateObject[{2022,12,21,0,0,s},TimeZone->0]],{s,0,86400}]
Out[]=
{-23.4381,{s78754.2}}
In[]:=
DateObject[{2022,12,21,0,0,s/.Last[%]},TimeZone->0]
Out[]=
Wed 21 Dec 2022 21:52:34GMT
In[]:=
AstroPosition
Sun
STAR
,"Ecliptic"["Longitude"]
Out[]=
36.1186
In[]:=
sunLongitude//ClearAll​​sunLongitude[date_?DateObjectQ]:=AstroPosition
Sun
STAR
,{"Ecliptic",date}["Longitude"]
In[]:=
DateListPlotTable{date,sunLongitude[date]},date,DateRange
Sat 1 Jan 2022
,
Sun 1 Jan 2023

Out[]=
In[]:=
FindRoot[sunLongitude[DateObject[{2022,12,21,0,0,s},TimeZone->0]]-270,{s,0,86400}]
Out[]=
{s78493.}
In[]:=
DateObject[{2022,12,21,0,0,s/.Last[%]},TimeZone->0]
Out[]=
Wed 21 Dec 2022 21:48:13GMT
What is the difference between the two?
In[]:=
Wed 21 Dec 2022 21:48:13GMT
-
Wed 21 Dec 2022 21:52:34GMT
Out[]=
-4.35336
min
This is a function for the ecliptic definition of the winter solstice.
In[]:=
WinterSolstice//ClearAll​​WinterSolstice[year_?IntegerQ]:=DateObject[{year,12,21,0,0,s/.Last[FindRoot[sunLongitude[DateObject[{year,12,21,0,0,s},TimeZone->0]]-270,{s,0,86400}]]},TimeZone->0]
In[]:=
WinterSolstice[2003]
Out[]=
Mon 22 Dec 2003 07:03:48GMT
In[]:=
WinterSolstice[2023]
Out[]=
Fri 22 Dec 2023 03:27:21GMT
In[]:=
WinterSolstice[2022]
Out[]=
Wed 21 Dec 2022 21:48:13GMT
This computes the winter solstice defined by declination.
In[]:=
DeclinationWinterSolstice//ClearAll​​DeclinationWinterSolstice[year_?IntegerQ]:=DateObject[{year,12,21,0,0,s/.Last[FindMinimum[sunDeclination[DateObject[{year,12,21,0,0,s},TimeZone->0]],{s,0,86400}]]},TimeZone->0]
In[]:=
DeclinationWinterSolstice[2022]
Out[]=
Wed 21 Dec 2022 21:52:34GMT
Here is are two tables of winter solstices, one for each definition.
In[]:=
Table[DeclinationWinterSolstice[year],{year,2005,2025}]
Out[]=

Wed 21 Dec 2005 18:41:56GMT
,
Fri 22 Dec 2006 00:20:16GMT
,
Sat 22 Dec 2007 06:05:58GMT
,
Sun 21 Dec 2008 12:03:47GMT
,
Mon 21 Dec 2009 17:43:03GMT
,
Tue 21 Dec 2010 23:46:31GMT
,
Thu 22 Dec 2011 05:20:13GMT
,
Fri 21 Dec 2012 11:14:37GMT
,
Sat 21 Dec 2013 17:10:42GMT
,
Sun 21 Dec 2014 23:00:58GMT
,
Tue 22 Dec 2015 04:50:36GMT
,
Wed 21 Dec 2016 10:38:38GMT
,
Thu 21 Dec 2017 16:36:20GMT
,
Fri 21 Dec 2018 22:15:38GMT
,
Sun 22 Dec 2019 04:20:54GMT
,
Mon 21 Dec 2020 10:03:13GMT
,
Tue 21 Dec 2021 15:57:23GMT
,
Wed 21 Dec 2022 21:52:34GMT
,
Fri 22 Dec 2023 03:18:26GMT
,
Sat 21 Dec 2024 09:28:04GMT
,
Sun 21 Dec 2025 15:00:31GMT

In[]:=
Table[WinterSolstice[year],{year,2005,2025}]
Out[]=

Wed 21 Dec 2005 18:34:56GMT
,
Fri 22 Dec 2006 00:22:05GMT
,
Sat 22 Dec 2007 06:07:48GMT
,
Sun 21 Dec 2008 12:03:45GMT
,
Mon 21 Dec 2009 17:46:47GMT
,
Tue 21 Dec 2010 23:38:27GMT
,
Thu 22 Dec 2011 05:30:02GMT
,
Fri 21 Dec 2012 11:11:36GMT
,
Sat 21 Dec 2013 17:11:00GMT
,
Sun 21 Dec 2014 23:03:01GMT
,
Tue 22 Dec 2015 04:47:56GMT
,
Wed 21 Dec 2016 10:44:10GMT
,
Thu 21 Dec 2017 16:27:56GMT
,
Fri 21 Dec 2018 22:22:44GMT
,
Sun 22 Dec 2019 04:19:26GMT
,
Mon 21 Dec 2020 10:02:20GMT
,
Tue 21 Dec 2021 15:59:18GMT
,
Wed 21 Dec 2022 21:48:13GMT
,
Fri 22 Dec 2023 03:27:21GMT
,
Sat 21 Dec 2024 09:20:33GMT
,
Sun 21 Dec 2025 15:03:04GMT

Here are the differences.
In[]:=
Table[DeclinationWinterSolstice[year]-WinterSolstice[year],{year,2005,2025}]
Out[]=

7.00134
min
,
-1.82472
min
,
-1.83106
min
,
2.01831
s
,
-3.73725
min
,
8.06383
min
,
-9.81324
min
,
3.013
min
,
-17.698
s
,
-2.0577
min
,
2.65932
min
,
-5.54052
min
,
8.38678
min
,
-7.09042
min
,
1.46626
min
,
53.1511
s
,
-1.92186
min
,
4.35336
min
,
-8.9209
min
,
7.51419
min
,
-2.56164
min

The minimum and maximum of the difference between the two definitions.
In[]:=
MinMax[%]
Out[]=

-9.81324
min
,
8.38678
min

In[]:=
Table[Abs[DeclinationWinterSolstice[year]-WinterSolstice[year]],{year,2005,2025}]
Out[]=

7.00134
min
,
1.82472
min
,
1.83106
min
,
2.01831
s
,
3.73725
min
,
8.06383
min
,
9.81324
min
,
3.013
min
,
17.698
s
,
2.0577
min
,
2.65932
min
,
5.54052
min
,
8.38678
min
,
7.09042
min
,
1.46626
min
,
53.1511
s
,
1.92186
min
,
4.35336
min
,
8.9209
min
,
7.51419
min
,
2.56164
min

I applied the absolute value.
In[]:=
MinMax[%]
Out[]=

2.01831
s
,
9.81324
min

In[]:=
SummerSolstice//ClearAll​​SummerSolstice[year_?IntegerQ]:=DateObject[{year,12,21,0,0,s/.Last[FindRoot[sunLongitude[DateObject[{year,12,21,0,0,s},TimeZone->0]]-90,{s,0,86400}]]},TimeZone->0]
In[]:=
SummerSolstice[2022]
Out[]=
Tue 21 Jun 2022 09:13:51GMT
In[]:=
VernalEquinox//ClearAll​​VernalEquinox[year_?IntegerQ]:=DateObject[{year,12,21,0,0,s/.Last[FindRoot[sunLongitude[DateObject[{year,12,21,0,0,s},TimeZone->0]]-0,{s,0,86400}]]},TimeZone->0]
In[]:=
VernalEquinox[2022]
FindRoot
:Failed to converge to the requested accuracy or precision within 100 iterations.
Out[]=
Sun 20 Mar 2022 15:37:20GMT
In[]:=
AutumnalEquinox//ClearAll​​AutumnalEquinox[year_?IntegerQ]:=DateObject[{year,12,21,0,0,s/.Last[FindRoot[sunLongitude[DateObject[{year,12,21,0,0,s},TimeZone->0]]-180,{s,0,86400}]]},TimeZone->0]
In[]:=
AutumnalEquinox[2022]
Out[]=
Fri 23 Sep 2022 01:03:41GMT
In[]:=
EquinoxesAndSolstices//ClearAll​​EquinoxesAndSolstices[year_?IntegerQ]:=<|"spring"->VernalEquinox[year],"summer"->SummerSolstice[year],"autumn"->AutumnalEquinox[year],"winter"->WinterSolstice[year]|>
Now I can make a manipulate for equinoxes and solstices.