A
A
Alexey Bugaev2019-11-23 15:55:25
git
Alexey Bugaev, 2019-11-23 15:55:25

How to display formatted date in log?

I saw in the screencast that in the log in order to display only the date and time they write --date=format:'%F%R'.
i.e. git log --pretty='%cd %s' --date=format:'%F %R'
I have an error: fatal: invalid strftime format: '%F %R'
could this be because what is my windows?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Bugaev, 2019-11-23
@aleksei13b

I solved the problem myself by adding --date=format:'%Y-%m-%d %H:%M:%S' instead of --date=format:'%F %R'

L
Lynn "Coffee Man", 2019-11-23
@Lynn

https://git-scm.com/docs/git-log#_commit_formatting
I recommend reading the documentation, and not just watching screencasts. In particular, the documentation lists the available options for the date and format/pretty flags.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question