First we need two different states to explain what is written in religious literature as you mentioned. These two state however gives rise to a state of temporal one follow another one. The first state is state of God being, and the second state God and creation being. We believe that God is in state of timeless and cannot be in state of temporal which is contradictory with the picture that is provided in religious literature.
Time is ultimately the comparison of one thing to another. Before creation, there were no physical things, thus nothing to compare nothing to (God, being Divine, is not a “thing”.)
When God created the heavens and the earth, he set things in motion. We can now observe one thing as it move relative to another thing. We can also abstract this as a comparison to “time”.
As beings of flesh, we experience time as an inflexible truth, but this “truth” is due to our limited senses. As something moves close to the speed of light, for instance, its movements relative to slower things changes. It “ages” slower than things that are slower. This is called relativity (you literally have to be Einstein to properly understand it…).
Since “time” is merely a standard convention used to compare the motions of things, we can only trace “time” back to t=0.0000… seconds, when God created the first two things to compare. According to the most common theories, we are at approximately: t=441,797,000,000,000,000 seconds (approximately 14 billion years).
Prior to t=0, our math simply falls apart, because there is nothing to calculate. We can trace particles on a reverse trajectory back into the Big Bang, but before that there are no particles to track. No particles of matter; no time!
What we have is a being of Divine substance, who miraculously created particles of universal substance, which, with the perfect foresight that only a divine creator could achieve, grew into beings made in God’s own image. There is no contradiction that God must be within time, because in fact, time began from God!