You can't set it to date in the camera, so I presume you mean your computer used the date and then the number.
The camera will reset the number when it runs out of the four digits it has at its disposal. So normally it will go back to 0001 after you take image 9999. But it's possible to reset it whenever you like, or to set it to reset when you swap memory cards. Perhaps you did that inadvertently?
It can also be reset if you change to a memory card with a higher number than the current file number. If you put in a card where number 9999 already is present, it will restart from 0001.
The long in the short is that don't use the file number for anything vital in your way of storing and finding the files, since these numbers should be considered totally random. Then you have no problem when they do seem to change randomly.
It is possible to set the number to whatever you like, but I don't see any point in even listing the procedure, as it doesn't solve anything in the long run.