Another interpretation: when he would see them grinding manna to send down to Israel, he knew it was day; and when it was coming down to them, he knew it was night.
How Moses Knew Day from Night by the Grinding of the Manna
Yalkut Shimoni on Torah 406:3
דָּבָר אַחֵר. כְּשֶׁהָיָה רוֹאֶה אוֹתָן שֶׁשּׁוֹחֲקִין מָן לְהוֹרִיד לְיִשְׂרָאֵל, הָיָה יוֹדֵעַ שֶׁהוּא יוֹם, וּכְשֶׁהָיָה יוֹרֵד לָהֶם, הָיָה יוֹדֵעַ שֶׁהוּא לָיְלָה.