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.

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?

  • Git Post Hook to Kick Off Jenkins Job
  • github releases in relation to branching, as used by jitpack
  • Starting to use Maven on existing project without losing GIT history
  • NoNodeAvailableException elasticsearch in one IntelliJ project but not in other with same programmatic and elasticsearch.yml configuration and code
  • What classpath does maven set for different goals? Can you provide a link to official docs?
  • service entry keeps disappearing from manifest
  • Maven build for git committed code
  • How do you merge in GIT on Windows?
  • 2 Solutions collect form web for “Git Commit Object Author and Commiter Fields”

    The git commit date format states:

    Git internal format

    It is <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 +0200.

    See:

    • 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.

    Git Baby is a git and github fan, let's start git clone.