Exodus 34:23

Thrice in the year shall all your men children appear before the Lord GOD, the God of Israel.

The command belongs to the time when Moses remained forty days and nights in communion with God on the mount, miraculously sustained while apart from the people. There he received the two tables of stone bearing the words of the covenant, the ten commandments. He then came down with his face reflecting the glory of the divine presence.

It is part of what God requires of His people, given to keep them from becoming careless and indifferent in obedience. It stands together with God's specification of the very day to be kept, the seventh day. That specification leaves no excuse for thinking it does not matter what day is kept, and no excuse for keeping the first day of the week.