Matsya Purana (Jyotisha Selections) · by Vyasa
Chapter 4 · The Sun's Paths, Day and Night
सूर्यगतिः
तस्मात् सन्ध्येति तामाहुरुषाव्युष्टैर्यथान्तरम् ।उषारात्रिः स्मृता विप्रैर्व्युष्टिश्चापि अहः स्मृतम् ॥ ८४ ॥
In the full Matsya Purana this is print ch 123 (standard ch 124), verse 84.
So they call it sandhya (twilight), as the gap between usha (the last part of night) and vyushti (daybreak). The learned say usha is night and vyushti is day.
Simple meaning: Twilight is the gap between the end of night and daybreak. One side counts as night, one as day.
त्रिंशत्कलो मुहूर्तस्तु अहस्ते दशपञ्च च ।
A muhurta is 30 kalas. The day has 15 muhurtas. Days shrink and grow by parts of the day.
सन्ध्या मुहूर्तमात्रायां ह्रासवृद्धी तु ते स्मृते ।
Twilight lasts one muhurta, whether days are short or long. Then comes the Sun's rise past the horizon line.
प्रातः स्मृतस्ततः कालो भागांश्चाहुश्च पञ्च च ।
The first three muhurtas after sunrise are morning. The day has five parts; next comes the forenoon.