The way you do this looks Pythonic. Several alternatives (not necessarily suggestions):
You can skip os.chdir(target) and make os.path.join(target, filename) in a loop.
You can do strftime('{0}-%Y-%m-%d-%H:%M:%S.jpg'.format(prefix)) to avoid string concatenation. This is the only thing I would recommend.
You can reuse the variable name, for example temp_date instead of t , v and x . It will be okay.
You can skip saving temporary variables and just do:
for filename in os.listdir(target): os.rename(filename, datetime.fromtimestamp( os.path.getmtime(filename)).strftime( '{0}-%Y-%m-%d-%H:%M:%S.jpeg'.format(prefix)))
You can generalize your function for working with recursive directories with os.walk() .
You may find the file extension of the file so that it is correct not only for .jpeg s.
You can make sure that you only rename the form files DSCN1#####.jpeg
source share