Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

A simple utility to set the modified and accessed timestamps on files according to their filenames

Project description

I’ve created this little script in order to make my picture collections more sortable. It will timestamp files in a directory tree according to each file’s name. It supports various different file extensions with optional prefixes and suffixes. Also, it uses a datetime.datetime.strptime to extract the time from the filename, so it’s easily changeable to suit your needs. Out of the box it supports the following:

  • prefixes: [‘IMG’, ‘PIC’, ‘PANO’, ‘VID’] or no prefix
  • file types (extensions): [‘.JPG’, ‘.JPEG’, ‘.MP4’]
  • date format: %Y%m%d_%H%M%S, eg: 20150131_120017

Installation: pip install name2time


Clone the project & run from source

Usage: name2timestamp [–fmt FORMAT] [-y or –yes] DIRECTORY

Download: Download from pypi: Checkout source:

Project details

Release history Release notifications

This version


Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page