|
5 | 5 | author_name: dbussink |
6 | 6 | --- |
7 | 7 |
|
8 | | -Timezones always present interesting engineering problems. Git can handle timezone |
9 | | -information by storing timezone offsets. We have improved support in our API |
10 | | -as well where we create these kinds of git objects. If you create commits through |
11 | | -the API, we now allow for specifying timezone information more accurately. |
| 8 | +We have improved support for handling timezones in our API. For example if you |
| 9 | +create commits through the API, we now allow for specifying timezone information |
| 10 | +more accurately. |
12 | 11 |
|
13 | 12 | We apply the following rules, in order of priority, to determine timezone |
14 | 13 | information for API calls: |
|
18 | 17 | For API calls that allow for a timestamp to be specified, we use that exact |
19 | 18 | timestamp. An example of this is the [Commits API](/v3/git/commits). |
20 | 19 |
|
21 | | -These timestamps look something like `2014-02-27T15:05:06+01:00` |
| 20 | +These timestamps look something like `2014-02-27T15:05:06+01:00`. Also see |
| 21 | +[this example](http://developer.github.com/v3/git/commits/#example-input) for |
| 22 | +how these timestamps can be specified. |
22 | 23 |
|
23 | 24 | #### Using the `Time-Zone` header |
24 | 25 |
|
25 | 26 | It is possible to supply a `Time-Zone` header which defines a timezone according |
26 | 27 | to the [list of names from the Olson database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). |
27 | 28 |
|
| 29 | + $ curl -H "Time-Zone: Europe/Amsterdam" -X POST https://api.github.com/repos/github/linguist/contents/new_file.md |
| 30 | + |
28 | 31 | This means that we generate a timestamp for the moment your API call is made in |
29 | 32 | the timezone this header defines. For example the [Contents API](/v3/repos/contents/) |
30 | 33 | generates a git commit for each addition or change and uses the current time |
|
0 commit comments