@dictionaric
"Araw" is the word for both the sun and day.
Magandang araw sa iyo. = A good day to you. - Although this actually covers 24 hours, we don't usually say this anymore at nighttime.
"Umaga" is morning and "hapon" is afternoon. "Tanghali" is noon.
"Gabi" is after 6 p.m.. We loosely use "gabi" also for the dark hours after midnight, but when referring to time, after midnight would be "umaga", i.e., 1 a.m. is "ala-una ng umaga". The early morning hours, around 4 and 5 a.m. are sometimes called "madal
íng araw". "Ala-una ng hapon" is 1 p.m. and "alas-sais ng hapon/gabi" is 6 p.m.. The average time of sunset here is around 6:30 p.m.. While there is still some sunlight after 6 p.m., we may still use "hapon".
"Magandang umaga" would apply from dawn to noon.
"Magandang tanghali" may be used at 12 noon, give or take about half an hour.
"Magandang hapon" is for the afternoon up to 6 p.m..
To greet someone after 6 p.m., we'd say "magandang gabi" and that would include the dark hours after midnight. "Magandang gabi" is also both "good evening" and "good night".