Rabbi Yishmael son of Rabbi Yosi says: Here my father prayed the prayer of the Sabbath on the eve of the Sabbath. And Rabbi Yochanan raised a difficulty: "Here my father prayed the prayer of the Sabbath on the eve of the Sabbath" should not need to be raised as a difficulty, for the donkey-drivers were going up from Arav to Sepphoris and saying, "Rabbi Chanina son of Rabbi Dosa has already prayed in his town." And if you wish to raise a difficulty, raise it on this difficult case: "Here my father prayed the prayer of the weekday on the Sabbath." Rabbi Yosi said: This too you should not raise as a difficulty, for Rabbi was sitting and expounding, and he said to Abba Yudan his interpreter, "Announce before the congregation that they should pray the weekday prayer while the day still stands." It is written at the end of the section: What is the meaning of "And God finished on the seventh day" (Genesis 2:2)? It is like one who strikes with a hammer upon the anvil: he raises it while it is still day and brings it down once it has grown dark. Flesh and blood, who does not know its moment nor its instants nor its hours, adds from the profane to the holy; but the Holy One, blessed be He, who knows its instants and its moments and its hours, enters it by a hairsbreadth.
How the Holy One Enters the Sabbath by a Hairsbreadth
Yalkut Shimoni on Torah 16:16
רַבִּי יִשְׁמָעֵאל בְּרַבִּי יוֹסִי אוֹמֵר, כָּאן הִתְפַּלֵּל אַבָּא שֶׁל שַׁבָּת בְּעֶרֶב שַׁבָּת וְרַבִּי יוֹחָנָן מַקְשֵׁי, כָּאן הִתְפַּלֵּל אַבָּא שֶׁל שַׁבָּת בְּעֶרֶב שַׁבָּת וְלָא הָוֵי צָרִיךְ מַקְשֵׁי, דְּהָא חַמְרָא הָוּוּ סָלְקִין מִן עֲרָב לְצִפּוֹרִי וְאָמְרִין כְּבָר הִתְפַּלֵּל רַבִּי חֲנִינָא בְּרַבִּי דּוֹסָא בְּעִירוֹ וְאִי בָּעִית מַקְשֵׁי עַל הֲדֵין קַשְׁיָא כַּאן הִתְפַּלֵּל אַבָּא שֶׁל אֶחָד בְּשַׁבָּת בְּשַׁבָּת אָמַר רַבִּי יוֹסִי אַף דֵּין לֹא תִּקְשֵׁי, דְּהָא רַבִּי הָוֵי יָתִיב וְדָרִישׁ וְאָמַר לְאַבָּא יוּדָן אֲמוֹרֵהּ אַכְרוּז קַמֵּי צִבּוּרָא יְצַלּוּן דְּחוֹלָא עַד יוֹמָא קָאֵם. כָּתוּב בְּסוֹף הַפָּרָשָׁה: (בראשית ב ב) מַהוּ וַיְכַל אֱלֹהִים בַּיּוֹם הַשְּׁבִיעִי, כָּזֶה שֶׁמַּכֶּה בְּקֻרְנָס עַל גַּבֵּי הַסַּדָּן, אַגְבְּהָהּ מִבְּעוֹד יוֹם וְהוֹרִידָהּ מִשֶּׁתֶּחְשַׁךְ בָּשָר וָדָם שֶׁאֵינוֹ יוֹדֵעַ לֹא עִתּוֹ וְלֹא רְגָעָיו וְלֹא שְׁעוֹתָיו מוֹסִיף מֵחוֹל עַל הַקֹּדֶשׁ, אֲבָל הַקָּדוֹשׁ בָּרוּךְ הוּא שֶׁהוּא יוֹדֵעַ רְגָעָיו וְעִתָּיו וּשְׁעוֹתָיו נִכְנָס בּוֹ כְּחוּט הַשַּׂעֲרָה.