diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/conversions.py b/SAS/TMSS/backend/src/tmss/tmssapp/conversions.py
index fd336452264fba8dc57b364da04e45165cdf1c09..2214f6f987c6181537354f9afb0e8871391c101d 100644
--- a/SAS/TMSS/backend/src/tmss/tmssapp/conversions.py
+++ b/SAS/TMSS/backend/src/tmss/tmssapp/conversions.py
@@ -9,6 +9,7 @@ from astropy.coordinates import Angle, get_body
 import astropy.time
 from functools import lru_cache
 from typing import Tuple
+from lofar.common.datetimeutils import round_to_second_precision
 from lofar.sas.tmss.tmss.tmssapp.models.calculations import StationTimeline
 from lofar.sas.tmss.tmss.tmssapp.models.specification import CommonSchemaTemplate
 from django.db.utils import IntegrityError
@@ -136,26 +137,20 @@ def timestamps_and_stations_to_sun_rise_and_set(timestamps: tuple, stations: tup
     and added to the database for possible future retrieval (optional parameter must be true).
     Storing the pre-calculated data into a database makes retrieval faster.
 
-    The day/sunrise/sunset is always on the date of the timestamp.
-    The night is usually the one _starting_ on the date of the time stamp, unless the given timestamp falls before
-    sunrise, in which case it is the night _ending_ on the timestamp date.
+    The sunrise/sunset is always on the date of the timestamp.
 
     :param timestamps: tuple of datetimes, e.g. datetime(2020, 1, 1)
     :param stations: tuple of station names, e.g. ("CS002")
     :param angle_to_horizon: the angle between horizon and given coordinates for which rise and set times are returned
     :param: create_when_not_found: Add data to database if not found in database and so calculated for first time
     :return A dict that maps station names to a nested dict that contains lists of start and end times for sunrise,
-            sunset, day and night, on each requested date.
+            sunset, on each requested date.
         E.g.
         {"CS002":
             {   "sunrise": [{"start": datetime(2020, 1, 1, 6, 0, 0)), "end": datetime(2020, 1, 1, 6, 30, 0)},
                             {"start": datetime(2020, 1, 2, 6, 0, 0)), "end": datetime(2020, 1, 2, 6, 30, 0)}],
                 "sunset": [{"start": datetime(2020, 1, 1, 18, 0, 0)), "end": datetime(2020, 1, 1, 18, 30, 0)},
-                           {"start": datetime(2020, 1, 2, 18, 0, 0)), "end": datetime(2020, 1, 2, 18, 30, 0)}],
-                "day": [{"start": datetime(2020, 1, 1, 6, 30, 0)), "end": datetime(2020, 1, 1, 18, 00, 0)},
-                        {"start": datetime(2020, 1, 2, 6, 30, 0)), "end": datetime(2020, 1, 2, 18, 00, 0)}],
-                "night": [{"start": datetime(2020, 1, 1, 18, 30, 0)), "end": datetime(2020, 1, 2, 6, 0, 0)},
-                          {"start": datetime(2020, 1, 2, 18,3 0, 0)), "end": datetime(2020, 1, 3, 6, 0, 0)}],
+                           {"start": datetime(2020, 1, 2, 18, 0, 0)), "end": datetime(2020, 1, 2, 18, 30, 0)}]
             }
         }
     """
@@ -165,8 +160,6 @@ def timestamps_and_stations_to_sun_rise_and_set(timestamps: tuple, stations: tup
         return_dict.setdefault(station, {})
         return_dict[station].setdefault("sunrise", [])
         return_dict[station].setdefault("sunset", [])
-        return_dict[station].setdefault("day", [])
-        return_dict[station].setdefault("night", [])
 
         # TODO: cache these with the memcached server, see TMSS-1980. Remove StationTimeline model and table.
 
@@ -186,15 +179,8 @@ def timestamps_and_stations_to_sun_rise_and_set(timestamps: tuple, stations: tup
                 sunset_dict = {"start": obj.sunset_start, "end": obj.sunset_end}
             else:
                 # Not found in database so calculate it
-                try:
-                    sunrise_dict, sunset_dict = calculate_and_get_sunrise_and_sunset_of_observer_day(observer, timestamp, angle_to_horizon, n_grid_points=n_grid_points)
-                except Exception as exp:
-                    logger.warning("Can not calculate sunrise/sunset for station=%s, timestamp=%s" % (station,timestamp))
-                    # raise exp
-                    # Don't let it crash for now
-                    # The stations SE607 and LV614 station has problems calculation on 2021-07-01....
-                    # The SE607 also on 2021-06-04 ??
-                    break
+                sunrise_dict, sunset_dict = calculate_and_get_sunrise_and_sunset_of_observer_day(observer, timestamp, angle_to_horizon, n_grid_points=n_grid_points)
+
                 # Add to database
                 if create_when_not_found:
                     try:
@@ -214,41 +200,78 @@ def timestamps_and_stations_to_sun_rise_and_set(timestamps: tuple, stations: tup
                         else:
                             raise
 
-            # Derive day/night from sunset/sunrise
+            # Create overall result
+            return_dict.setdefault(station, {})
+            return_dict[station]["sunrise"].append(sunrise_dict)
+            return_dict[station]["sunset"].append(sunset_dict)
+
+    return return_dict
+
+def timestamps_and_stations_to_sun_rise_set_day_night(timestamps: tuple, stations: tuple, angle_to_horizon: Angle=SUN_SET_RISE_ANGLE_TO_HORIZON,
+                                                      create_when_not_found=False, n_grid_points: int=SUN_SET_RISE_PRECISION) -> dict:
+    """
+    Same as method timestamps_and_stations_to_sun_rise_and_set, but now with the 'day' and 'night' as well.
+
+    The day/sunrise/sunset is always on the date of the timestamp.
+    The night is usually the one _starting_ on the date of the time stamp, unless the given timestamp falls before
+    sunrise, in which case it is the night _ending_ on the timestamp date.
+
+    :param timestamps: tuple of datetimes, e.g. datetime(2020, 1, 1)
+    :param stations: tuple of station names, e.g. ("CS002")
+    :param angle_to_horizon: the angle between horizon and given coordinates for which rise and set times are returned
+    :param: create_when_not_found: Add data to database if not found in database and so calculated for first time
+    :return A dict that maps station names to a nested dict that contains lists of start and end times for sunrise,
+            sunset, day and night, on each requested date.
+        E.g.
+        {"CS002":
+            {   "sunrise": [{"start": datetime(2020, 1, 1, 6, 0, 0)), "end": datetime(2020, 1, 1, 6, 30, 0)},
+                            {"start": datetime(2020, 1, 2, 6, 0, 0)), "end": datetime(2020, 1, 2, 6, 30, 0)}],
+                "sunset": [{"start": datetime(2020, 1, 1, 18, 0, 0)), "end": datetime(2020, 1, 1, 18, 30, 0)},
+                           {"start": datetime(2020, 1, 2, 18, 0, 0)), "end": datetime(2020, 1, 2, 18, 30, 0)}],
+                "day": [{"start": datetime(2020, 1, 1, 6, 30, 0)), "end": datetime(2020, 1, 1, 18, 00, 0)},
+                        {"start": datetime(2020, 1, 2, 6, 30, 0)), "end": datetime(2020, 1, 2, 18, 00, 0)}],
+                "night": [{"start": datetime(2020, 1, 1, 18, 30, 0)), "end": datetime(2020, 1, 2, 6, 0, 0)},
+                          {"start": datetime(2020, 1, 2, 18,3 0, 0)), "end": datetime(2020, 1, 3, 6, 0, 0)}],
+            }
+        }
+    """
+    return_dict = {}
+    # Derive day/night from sunset/sunrise
+    for station in stations:
+        # Create overall result
+        return_dict.setdefault(station, {})
+        return_dict[station].setdefault("sunrise", [])
+        return_dict[station].setdefault("sunset", [])
+        return_dict[station].setdefault("day", [])
+        return_dict[station].setdefault("night", [])
+
+        for timestamp in timestamps:
+            today = timestamps_and_stations_to_sun_rise_and_set([timestamp], [station], angle_to_horizon, create_when_not_found, n_grid_points)
+            sunrise_dict = today[station]['sunrise'][0]
+            sunset_dict = today[station]['sunset'][0]
+            return_dict[station]['sunrise'].append(sunrise_dict)
+            return_dict[station]['sunset'].append(sunset_dict)
+
+            # the 'day' start/end is always for 'today' of this timestamp
             day_dict = {"start": sunrise_dict["end"], "end": sunset_dict["start"]}
+            return_dict[station]['day'].append(day_dict)
 
+            # 'night', can be either next- or previous night
             if timestamp >= sunrise_dict["start"]:
                 # Determine next sunrise start
-                try:
-                    obj_next = StationTimeline.objects.get(station_name=station,
-                                                           timestamp=datetime.date(timestamp + timedelta(days=1)))
-                    sunrise_next_start = obj_next.sunrise_start
-                except:
-                    sunrise_next_start = observer.sun_rise_time(time=Time(sunrise_dict["end"]), horizon=-angle_to_horizon,
-                                                                which='next',
-                                                                n_grid_points=SUN_SET_RISE_PRECISION).to_datetime()
-                night_dict = {"start": sunset_dict["end"], "end": sunrise_next_start}
+                tomorrow = timestamps_and_stations_to_sun_rise_and_set([timestamp + timedelta(days=1)], [station], angle_to_horizon, create_when_not_found, n_grid_points)
+                next_sunrise_dict = tomorrow[station]['sunrise'][0]
+                night_dict = {"start": sunset_dict["end"], "end": next_sunrise_dict['start']}
             else:
                 # Determine previous sunset end
-                try:
-                    obj_prev = StationTimeline.objects.get(station_name=station,
-                                                           timestamp=datetime.date(timestamp - timedelta(days=1)))
-                    sunset_previous_end = obj_prev.sunrise_start
-                except:
-                    sunset_previous_end = observer.sun_set_time(time=Time(sunrise_dict["start"]), horizon=-angle_to_horizon,
-                                                                which='previous',
-                                                                n_grid_points=SUN_SET_RISE_PRECISION).to_datetime()
-                night_dict = {"start": sunset_previous_end, "end": sunrise_dict["start"]}
-
-            # Create overall result
-            return_dict.setdefault(station, {})
-            return_dict[station]["sunrise"].append(sunrise_dict)
-            return_dict[station]["sunset"].append(sunset_dict)
-            return_dict[station]["day"].append(day_dict)
-            return_dict[station]["night"].append(night_dict)
+                yesterday = timestamps_and_stations_to_sun_rise_and_set([timestamp - timedelta(days=1)], [station], angle_to_horizon, create_when_not_found, n_grid_points)
+                prev_sunset_dict = yesterday[station]['sunset'][0]
+                night_dict = {"start": prev_sunset_dict["end"], "end": sunrise_dict["start"]}
+            return_dict[station]['night'].append(night_dict)
 
     return return_dict
 
+
 # a guesstimate for a reasonable cache size for astropy results
 # roughly 50 stations, 365*24*12 timestamps (1year, 24 hours, 12/h), 1000 coordinates
 # in reality the numbers are more likely to be: 4 stations, 150*24*12 timestamps (0.5year, 24 hours, 12/h), 250 coordinates
@@ -263,18 +286,62 @@ def calculate_and_get_sunrise_and_sunset_of_observer_day(observer, timestamp: da
     :param the angle between horizon and given coordinates for which rise and set times are returned
     :return: dictionaries (with 'start' and 'end' defined) of sunrise, sunset
     """
-    sunrise_start = observer.sun_rise_time(time=Time(datetime.combine(timestamp.date(), dtime(12, 0, 0))),
+    # prepare the return dicts
+    sunrise_dict = {"start": None, "end": None}
+    sunset_dict = {"start": None, "end": None}
+
+    noon = datetime.combine(timestamp.date(), dtime(12, 0, 0))
+    prev_midnight = noon - timedelta(hours=12)
+    next_midnight = noon + timedelta(hours=12)
+
+    sunrise_start = observer.sun_rise_time(time=Time(noon),
                                            horizon=-angle_to_horizon, which='previous',
                                            n_grid_points=n_grid_points)
-    sunrise_end = observer.sun_rise_time(time=Time(sunrise_start), horizon=angle_to_horizon, which='next',
+    try:
+        sunrise_dict['start'] = round_to_second_precision(sunrise_start.to_datetime())
+    except ValueError:
+        # sun never rises
+        sun_body = astropy.coordinates.get_body("sun", Time(noon), observer.location)
+        if observer.target_is_up(target=sun_body, time=Time(noon), horizon=-angle_to_horizon):
+            sunrise_dict['start'] = prev_midnight
+        else:
+            sunrise_dict['start'] = noon
+
+    sunrise_end = observer.sun_rise_time(time=Time(sunrise_dict['start']), horizon=angle_to_horizon, which='next',
                                          n_grid_points=n_grid_points)
-    sunset_start = observer.sun_set_time(time=sunrise_end, horizon=angle_to_horizon, which='next',
+    try:
+        sunrise_dict['end'] = round_to_second_precision(sunrise_end.to_datetime())
+    except ValueError:
+        # sun never rises
+        sun_body = astropy.coordinates.get_body("sun", Time(sunrise_dict['start']), observer.location)
+        if observer.target_is_up(target=sun_body, time=Time(sunrise_dict['start']), horizon=angle_to_horizon):
+            sunrise_dict['end'] = prev_midnight
+        else:
+            sunrise_dict['end'] = noon
+
+    sunset_start = observer.sun_set_time(time=Time(noon), horizon=angle_to_horizon, which='next',
                                          n_grid_points=n_grid_points)
-    sunset_end = observer.sun_set_time(time=sunset_start, horizon=-angle_to_horizon, which='next',
-                                       n_grid_points=n_grid_points)
+    try:
+        sunset_dict['start'] = round_to_second_precision(sunset_start.to_datetime())
+    except ValueError:
+        # sun never rises
+        sun_body = astropy.coordinates.get_body("sun", Time(noon), observer.location)
+        if observer.target_is_up(target=sun_body, time=Time(noon), horizon=angle_to_horizon):
+            sunset_dict['start'] = next_midnight
+        else:
+            sunset_dict['start'] = noon
 
-    sunrise_dict = {"start": sunrise_start.to_datetime(), "end": sunrise_end.to_datetime()}
-    sunset_dict = {"start": sunset_start.to_datetime(), "end": sunset_end.to_datetime()}
+    sunset_end = observer.sun_set_time(time=Time(sunset_dict['start']), horizon=-angle_to_horizon, which='next',
+                                       n_grid_points=n_grid_points)
+    try:
+        sunset_dict['end'] = round_to_second_precision(sunset_end.to_datetime())
+    except ValueError:
+        # sun never rises
+        sun_body = astropy.coordinates.get_body("sun", Time(noon), observer.location)
+        if observer.target_is_up(target=sun_body, time=Time(noon), horizon=-angle_to_horizon):
+            sunset_dict['end'] = next_midnight
+        else:
+            sunset_dict['end'] = noon
 
     return sunrise_dict, sunset_dict
 
diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/views.py b/SAS/TMSS/backend/src/tmss/tmssapp/views.py
index cc0805e394caee6899f9c1ab4a3dd1b8b2595bea..676bfa68e565c43a2e201b52de1512655a2f5a8c 100644
--- a/SAS/TMSS/backend/src/tmss/tmssapp/views.py
+++ b/SAS/TMSS/backend/src/tmss/tmssapp/views.py
@@ -27,7 +27,7 @@ from datetime import datetime, date, time, timedelta
 import dateutil.parser
 from astropy.coordinates import Angle
 import astropy.units
-from lofar.sas.tmss.tmss.tmssapp.conversions import local_sidereal_time_for_utc_and_station_as_pytime, timestamps_and_stations_to_sun_rise_and_set, coordinates_and_timestamps_to_separation_from_bodies, coordinates_timestamps_and_stations_to_target_rise_and_set, coordinates_timestamps_and_stations_to_target_transit, Pointing, create_location_for_station
+from lofar.sas.tmss.tmss.tmssapp.conversions import local_sidereal_time_for_utc_and_station_as_pytime, timestamps_and_stations_to_sun_rise_set_day_night, coordinates_and_timestamps_to_separation_from_bodies, coordinates_timestamps_and_stations_to_target_rise_and_set, coordinates_timestamps_and_stations_to_target_transit, Pointing, create_location_for_station
 from lofar.sas.tmss.tmss.tmssapp.adapters.keycloak import get_names_by_role_in_project
 from lofar.sas.tmss.tmss.tmssapp.viewsets.permissions import get_project_roles_for_user
 
@@ -296,7 +296,7 @@ def get_sun_rise_and_set(request):
     else:
         stations = tuple(stations.split(','))
 
-    return JsonResponse(timestamps_and_stations_to_sun_rise_and_set(timestamps, stations))
+    return JsonResponse(timestamps_and_stations_to_sun_rise_set_day_night(timestamps, stations))
 
 
 @permission_classes([AllowAny])