-1

I use this command in Git Bash:

git log -1 --date=local --pretty=format:'%ad' ce40c0f8f02e83892eb185aabea306ee2a3ab10e

I want to display the date in local time zone AND as DD-MMM-YYYY HH:MM:SS.

It seems I can either change the time zone to local (--date=local) or change the format (--date=format:'%d %b %Y %H:%M:%S'), but cannot seem to do both together.

ZygD
  • 22,092
  • 39
  • 79
  • 102
Aman Saggu
  • 99
  • 2
  • This question is a duplicate of [Retrieving git log in YYYY-MM-DD format in local time zone](https://stackoverflow.com/q/17910312/11725753) – EvgenKo423 May 05 '21 at 08:07

1 Answers1

0

Never mind, I got it:

git log -1 --date='format-local:%d-%m-%Y %H:%M:%S' \
           --pretty=format:'%H; %s; %an; %ae; %ad; %cn; %ce; %cd' \
           ce40c0f8f02e83892eb185aabea306ee2a3ab10e
EvgenKo423
  • 2,256
  • 2
  • 16
  • 23
Aman Saggu
  • 99
  • 2