Question

I searched for a standard format for using a date/time as part of a file name and was unable to come up with anything.

My question is two parts:

Is using time stamps to enforce unique in file names a poor practice?

I could get the time from the creation date and serialize the file names (file0001.bak, file0002.bak, etc) but just including the time stamp lets perform file operations such as mv 2011-01* somewhere/. Is there a downside to using this type of naming system?

The format I am using is YYYY-mm-dd_HH-MM-SS.

Is there a better format I should be using?

With this format should i be concerned with file system compatibility, str_to_date_parsing concerns, etc?

Thanks!

edit:

I might have wanted to leave out the enforce uniqueness bit since it's a single user generating backup using a cronjob (there shouldn't be any concurrency problems).

No correct solution

Licensed under: CC-BY-SA with attribution
scroll top