Skip to content

Commit c72c2e5

Browse files
committed
Add link to timestamp example and add curl example
Show how curl can be used to set the header and where more information on specifying timestamps can be found.
1 parent 24cee04 commit c72c2e5

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

content/changes/2014-02-27-timezone-handling-changes.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
author_name: dbussink
66
---
77

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

1312
We apply the following rules, in order of priority, to determine timezone
1413
information for API calls:
@@ -18,13 +17,17 @@
1817
For API calls that allow for a timestamp to be specified, we use that exact
1918
timestamp. An example of this is the [Commits API](/v3/git/commits).
2019

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

2324
#### Using the `Time-Zone` header
2425

2526
It is possible to supply a `Time-Zone` header which defines a timezone according
2627
to the [list of names from the Olson database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
2728

29+
$ curl -H "Time-Zone: Europe/Amsterdam" -X POST https://api.github.com/repos/github/linguist/contents/new_file.md
30+
2831
This means that we generate a timestamp for the moment your API call is made in
2932
the timezone this header defines. For example the [Contents API](/v3/repos/contents/)
3033
generates a git commit for each addition or change and uses the current time

0 commit comments

Comments
 (0)