Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change my git timezone offset?

I read that the --date argument when adding a commit can be used to specify the timestamp and the timezone offset. I'm curious if there's a way to globally set just the timezone offset so it matches my timezone.. I'm in EST which is -0500 from UTC, and whenever I commit and push to Github my contributions never shows up on the correct day. IE. it's 2:00 AM where I am but git sets the timezone offset to UTC. Now when I commit/push my changes to Github they will show up as 9 PM UTC.

I've got a bit of OCD acting up right now.

like image 268
Winter Avatar asked Oct 15 '14 05:10

Winter


1 Answers

Git gets the time zone from your system's configuration, so if you configure your system correctly then Git should use the correct time zone. Run date +%z to check your system's configuration.

Perhaps Git is using the correct time zone but GitHub is displaying the time using the wrong time zone. After you create a commit, run git show and check the offset. If it's correct, then the problem is with GitHub.

like image 56
Richard Hansen Avatar answered Oct 14 '22 10:10

Richard Hansen