int = SunLongestShortestDay(nDate, nSunDataSourceIndex)
This macro function checks whether nDate is the shortest or longest day of the year, based on the observer position corresponding to the Sun data source of index nSunDataSourceIndex.
•The result is 1 for the shortest day of the year and 2 for the longest day of the year.
•The length of the day is defined as the time between sunrise and sunset on nDate.
•If nDate does not correspond to the shortest or longest day of the year, then the function returns 0.
The following example identifies the shortest or longest day of the year, if either occurs on the date of the macro token.
sResult = ''
switch SunLongestShortestDay(n_TokenDate, 1)
case 1
sResult = 'Shortest day of the year'
case 2
sResult = 'Longest day of the year'
endswitch
See also: SunEarliestLatestSunrise, SunEarliestLatestSunset.
Topic 178545, last updated on 11-Oct-2026