The initial energy density produced in heavy ion collisions can be estimated with the Bjorken energy density formula after choosing a proper formation time $tau{_{rm F}}$. However, the Bjorken formula breaks down at low energies because it neglects the finite nuclear thickness. Here we include both the finite time duration and finite longitudinal extension of the initial energy production. When $tau{_{rm F}}$ is not too much smaller than the crossing time of the two nuclei, our results are similar to those from a previous study that only considers the finite time duration. In particular, we find that at low energies the initial energy density has a much lower maximum value but evolves much longer than the Bjorken formula, while at large-enough $tau{_{rm F}}$ and/or high-enough energies our result approaches the Bjorken formula. We also find a qualitative difference in that our maximum energy density $epsilon^{rm max}$ at $tau{_{rm F}}=0$ is finite, while the Bjorken formula diverges as $1/tau{_{rm F}}$ and the previous result diverges as $ln (1/tau{_{rm F}})$ at low energies but as $1/tau{_{rm F}}$ at high energies. Furthermore, our solution of the energy density approximately satisfies a scaling relation. As a result, the $tau{_{rm F}}$-dependence of $epsilon^{rm max}$ determines the $A$-dependence, and the weaker $tau{_{rm F}}$-dependence of $epsilon^{rm max}$ in our results at low energies means a slower increase of $epsilon^{rm max}$ with $A$.