Git Commit Object Author and Commiter Fields
I am trying to make a server using Java that runs on a Linux machine and I would like my server to support Git in a similar fashion to GitHub. I have figured out a lot of things to achieve this but there is one thing I would like to know…
Assuming I have the following Git object (with a header) deflated and stored in the file system.
- How to easily Git commit in Eclipse Neon
- How to use java git for java project
- Netbeans - Clone specific branch of bitbucket repository
- Is it possible to trigger Jenkins from one specific branch only?
- Can't call HTTPS content on a website to android app
- Git or Mercurial usage in Java projects
tree d35e45b7a3ec1bfd4d91b87c16d08fc4effc6dba parent 385f73f0f5d38c6258a7d55038c9ceb24cd63157 author ThePyroEagle <exampleEmail@example.com> 1418335844 +0000 commiter ThePyroEagle <exampleEmail@example.com> 1418335844 +0000
What does “1418335844 +0000” at the end mean?
I thought this might be a timestamp in milliseconds, but when I parsed it I got “17 January 1970” using the following code.
Date date = new Date(1418335844L); System.out.printf("Current Time: %s\n", (new SimpleDateFormat("dd MMMM yyyy")).format(date));
Whatever this may be, how would I go about parsing it?
2 Solutions collect form web for “Git Commit Object Author and Commiter Fields”
git commit date format states:
Git internal format
<unix timestamp> <time zone offset>, where:
<unix timestamp>is the number of seconds since the UNIX epoch.
<time zone offset>is a positive or negative offset from UTC. For example CET (which is 2 hours ahead UTC) is
- Epoch converter: 1418335844 => Thu, 11 Dec 2014 22:10:44 GMT
- “convert epoch time to date”
- “Java: Date from unix timestamp”
It’s a timestamp in seconds: 2014-12-11T22:10:44+00:00.