mirror of
https://github.com/jbranchaud/til
synced 2026-07-03 08:08:24 +00:00
Add Display All Git Log Entries In My Local Timezone as a Git TIL
This commit is contained in:
@@ -10,7 +10,7 @@ working across different projects via [VisualMode](https://www.visualmode.dev/).
|
||||
|
||||
For a steady stream of TILs, [sign up for my newsletter](https://visualmode.kit.com/newsletter).
|
||||
|
||||
_1774 TILs and counting..._
|
||||
_1775 TILs and counting..._
|
||||
|
||||
See some of the other learning resources I work on:
|
||||
|
||||
@@ -362,6 +362,7 @@ If you've learned something here, support my efforts writing daily TILs by
|
||||
- [Determine Absolute Path Of Top-Level Project Directory](git/determine-absolute-path-of-top-level-project-directory.md)
|
||||
- [Determine The Hash Id For A Blob](git/determine-the-hash-id-for-a-blob.md)
|
||||
- [Diffing With Patience](git/diffing-with-patience.md)
|
||||
- [Display All Git Log Entries In My Local Timezone](git/display-all-git-log-entries-in-my-local-timezone.md)
|
||||
- [Dropping Commits With Git Rebase](git/dropping-commits-with-git-rebase.md)
|
||||
- [Dry Runs in Git](git/dry-runs-in-git.md)
|
||||
- [Exclude A File From A Diff Output](git/exclude-a-file-from-a-diff-output.md)
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
# Display All Git Log Entries In My Local Timezone
|
||||
|
||||
I tend to work with remote teams distributed across across multiple time zones.
|
||||
In that context, it is important to have an awareness of what time zone each
|
||||
person is operating in and to communicate clearly around that.
|
||||
|
||||
When looking at the output for `git log` on a distributed team, the timestamps
|
||||
for each entry can be all over the place. If I want to understand when something
|
||||
was committed, I have to look at the time as well as the time zone offset and
|
||||
mentally translate it to my own time zone.
|
||||
|
||||
There is a `git config` option to alleviate this issue by having `git log`
|
||||
convert and display all timestamps into your local time zone.
|
||||
|
||||
```bash
|
||||
$ git config --global log.date rfc-local
|
||||
```
|
||||
|
||||
Running that will add this entry to your _global_ git config file:
|
||||
|
||||
```
|
||||
[log]
|
||||
date = rfc-local
|
||||
```
|
||||
|
||||
Now the time that was displaying as `Wed Apr 8 20:12:33 2026 -0400` will display
|
||||
as `Wed, 8 Apr 2026 19:12:33 -0500`.
|
||||
|
||||
This also helps with smoothing out differences from DST and for commits produced
|
||||
by AI agents in sandbox environments where the locale is set to UTC.
|
||||
Reference in New Issue
Block a user