Hide Forgot
Description of problem: Command "git log -n1 --pretty=format:%cd -- file" generates date in noncompatible format for "data --date". It generates date like "Tue Jul 19 11:35:05 2016 +0300", but it must be "Tue Jul 19 2016 11:35:05 +0300". Position of year is incorrect. Version-Release number of selected component (if applicable): git version 2.10.1 How reproducible: Command: date +%s --date="$(git log -n1 --pretty=format:%ad -- filename)" Result is: date: invalid date 'Tue Jul 19 11:35:05 2016 +0300' Steps to Reproduce: git log -n1 --pretty=format:%ad -- filename Actual results: Tue Jul 19 11:35:05 2016 +0300 Expected results: Tue Jul 19 2016 11:35:05 +0300
according to the man page: DATE STRING The --date=STRING is a mostly free format human readable date string such as "Sun, 29 Feb 2004 16:21:42 -0800" or "2004-02-29 16:21:42" or even "next Thursday". A date string may contain items indicating calendar date, time of day, time zone, day of week, relative time, relative date, and numbers. An empty string indicates the beginning of the day. The date string format is more complex than is easily documented here but is fully described in the info documentation. git generates something what should be used within date(1).
sorry, my bad.
Did you try it with --date=rfc? You can also use 'git config --global log.date rfc' to change the default.
Thanks, worked with --date=rfc