Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git: timezone and timestamp format

From git I can get the timestamp:

"2011-10-04 12:58:36 -0600" 

but is there any way to show it as:

"2011-10-04 06:58:36" 

So all I want is to get rid of the -0600 timezone offset. How can I do this? Thanks.

like image 734
SandyBr Avatar asked Oct 04 '11 17:10

SandyBr


People also ask

Does GIT store time zones?

The timezone tells everybody in which timzone do you live and in case security is important for you, you should omit these information. Other answers to this question focus on the author date, but for each commit Git stores a author date and a commit date. So you have to omit the timezone for both dates.

What time zone does GitHub use?

UTC. If the steps above don't result in any information, we use UTC as the timezone to create the git commit. If you have any questions or feedback, don't hesitate to contact us!

Are commits timestamped?

The commit timestamp, based on TrueTime technology, is the time when a transaction is committed in the database. The allow_commit_timestamp column option allows you to atomically store the commit timestamp into a column.


1 Answers

If you ask about git log, you can try and select most correct form from:

git log --date={relative,local,default,iso,rfc} 

--date=local seems to be the best candidate.

To make this permanent, use git config --global log.date local.

like image 171
Lazy Badger Avatar answered Sep 28 '22 11:09

Lazy Badger