I learnt that because English is not an inflected language word order is quite inflexible, i.e. (when)/ subject/verb/direct object/ indirect object/ How/where/ (when) '
so Time should be either in the beginning or in the end
Can I have a try at your sentence even though I'm not a native speaker, just an English teacher?
For six years he bore hardships in the mountains in order to attain enlightment.
Just a thought