The leading zero isn't an issue because it will sort correctly under both systems. The issue OP is having is that he's adding random numbers after the hhmmss section. If instead he added a delimiter before the random number the files would sort correctly under both systems as well, e.g. hhmmss_num.