I am given some dates and times in yymmdd-HHMMss format, e.g: 231030-150735, 231102-125814, 231109-114532, etc. I am interested in using these dates and times, as given, to limit the output of git log master between those dates and times. By default, the versions of git on both my local machine and my build server use YYYY-mm-dd HH:MM:ss format, so the equivalents of the above examples would be 2023-10-30 15:07:35, 2023-11-02 12:58:14 and 2023-11-09 11:45:32.
Limiting the commits between two dates in this default format works well and returns me data:
git log master --oneline --since='2023-11-02 12:58:14' --until='2023-11-09 11:45:32' | wc -l
101
Unfortunately, trying to apply my date-time format and applying the --date=format: flag to git does not appear to work:
git log master --oneline --date=format:%y%m%d-%H%M%S --since='231102-125814' --until='231109-114532' | wc -l
0
This is not too surprising given that the official git log documentation mentions, under section "Commit Limiting":
Note that these are applied before commit ordering and formatting options, such as --reverse.
By "these", it refers to commit limiting options, such as --until and --since, and date=format: is one of the "ordering and formatting options" that are mentioned.
Is there any way to enable this format for a specific git log query, without affecting global git configurations? Of course I can generate a YYYY-mm-dd HH:MM:ss format from a yymmdd-HHMMss format, but my only option to go from yy to YYYY is to prepend "20", and my code will break after 2099. I don't want my grandkids to have to figure this out, if git and coding as we know it exists by then.