Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am getting invalid date format 2011 when I try to the modified time, this works fine without the seconds

touch -t 2011 08 23 14 05 14 voucher.tpl

I am a little confused with the below that explains how to do this:

-t time specifies a particular time using this format:


where cc is the optional first 2 digits of the year, yy is the optional last 2 digits of the year, MM is the optional number of the month (01-12), dd is the optional day of the month, hh is the hour in 24 hour format (required), mm is the minutes (required), ss is the optional seconds.

share|improve this question
up vote 3 down vote accepted
$ touch -t 201108231405.14 voucher.tpl
$ ls -l --time-style='+%B %d %H:%M:%S' voucher.tpl
-rw-r--r-- 1 quanta quanta 0 August 23 14:05:14 voucher.tpl
share|improve this answer

touch -t 201108231405.14 voucher.tpl should work. It did for me.

Note that the time format specification does not include any spaces.

share|improve this answer

You are using the wrong format this should work ok

touch -t 201108231405.14 voucher.tpl


          use [[CC]YY]MMDDhhmm[.ss] instead of current time
share|improve this answer

Remove spaces. Also, you're missing the period between the mm and the ss. This will work:

touch -t 201108231405.14
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.