God knew in advance. “Remember the Sabbath day, to keep it holy. Six days shalt thou labour, and do all thy work: but the seventh day is the Sabbath of the Lord thy God.” - Exodus 20:8-10 KJV