Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

Which time zone is GitHub working from on their servers?

For example, a commit made on Sun Dec 2 05:01:00 2012 +0200 is interpreted by GitHub as a commit made on 1st December 2012 in the contributions calendar/graph.

Which is the first hour when a new day starts?

share|improve this question

migrated from stackoverflow.com Sep 25 '13 at 21:07

This question came from our site for professional and enthusiast programmers.

add comment

2 Answers 2

up vote 7 down vote accepted

GitHub uses a strategy that involves the date-time-offset pattern. When you make a commit, the timestamp includes your offset from UTC.

You can see this in the API docs for the Commits. The sample they show there uses a commit timestamp of "2010-04-10T14:10:01-07:00". This is a valid ISO8601 representation of a date-time-offset. For the person performing the commit, it was April 10th 2010 at 14:10:01. The item would show up on his commit calendar for Saturday, April 10th.

Git and GitHub do not attempt to normalize this data to the offset of the viewer, but they do take it into account when calculating relative time strings. For example, there's a commit on a project I work on that says it was made "1 hour ago". It's 1:30 my time, but when I hover over that text it looks like it was made at 2:30. How can that be? Because my offset is currently -07:00 and the person who made the commit has an offset of -05:00.

So there is no system-wide first hour of the start of a day. Two commits made at the exact same moment in time might appear on two different days even on the same calendar, if they were made by people in different time zones. In other words, a "GitHub day" is a virtual "floating" calendar date that aligns to the committer - not necessarily the viewer.

share|improve this answer
add comment

This is an interesting question, because Github keeps a history of some activities you do each day, plus it has a "longest streak" record.

I narrowed it down. I made a commit at 1am EST, and another at 6am EST. The 1am commit counted against the day before, and the 6am counted as the day of.

This corresponds with the comment on this question, that Also, GitHub servers are in Pacific Time (UTC-8). That seems quite likely.

Edit: Since answering this question, they've made it line up exactly to your local account. I've made commits slightly before and slightly after midnight, and they're credited to the correct dates on my commit graph.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.