Three GitHub Repo Timestamps Obtained through REST API: created_at, updated_at, and pushed_at (including a simple introduction to ISO 8601)

Jul. 28, 2024

"created_at", "updated_at", and "pushed_at"

In blog1, I record the way of obtaining information of a specific GitHub repository through REST API. The returned information is in JSON format, and in which there’re three key-value pairs concerning time:

1
2
3
4
5
6
7
{
  // ...
  "created_at": "2022-07-16T07:16:20Z",
  "updated_at": "2024-06-27T15:17:36Z",
  "pushed_at": "2024-06-27T15:17:32Z",
  // ...
}

"created_at" shows when the repository was created. As for the difference between pushed_at and updated_at, Ivan Zuzak explains it on Stack Overflow2:

The difference is that pushed_at represents the date and time of the last commit, whereas the updated_at represents the date and time of the last change the the repository. A change to the repository might be a commit, but it may also be other things, such as changing the description of the repo, creating wiki pages, etc. In other words, commits are a subset of updates, and the pushed_at timestamp will therefore either be the same as the updated_at timestamp, or it will be an earlier timestamp.

The answer is very clear. And, as Tomáš Hübelbauer comments2, updated_at will update if the repo is starred by someone. I verify this point simply; it’s right.


ISO 8601

Above three timestamps adopt the same date format, i.e. ISO 86013: yyyy-mm-ddThh:mm:ssZ, where:

  • T is the time designator that precedes the time components of the representation.
  • Z is the zone designator for the zero UTC4 offset.

UTC+00:005 is also known as:

  • Greenwich Mean Time (GMT)
  • Western European Time

UTC+0000 - 2021.svg
By Theklan - Own work, CC0, Link.

Different time zones adopt different UTC offsets, and they can be expressed in ISO 8601 date format like yyyy-mm-ddThh:mm:ss+hh:mm or yyyy-mm-ddThh:mm:ss-hh:mm. For example:

  • Pacific Time Zone (North America, Log Angeles)6

    • Pacific Standard Time (PST): yyyy-mm-ddThh:mm:ss-08:00
    • Pacific Daylight Time (PDT): yyyy-mm-ddThh:mm:ss-07:00
  • New York Time (EST, Eastern Standard Time)7
    • Eastern Standard Time (EST): yyyy-mm-ddThh:mm:ss−05:00
    • Eastern Daylight Time (EDT): yyyy-mm-ddThh:mm:ss−04:00
  • United Kingdom8
    • Western European Time (a.k.a. GMT): yyyy-mm-ddThh:mm:ssZ or yyyy-mm-ddThh:mm:ss+0000
    • British Summer Time: yyyy-mm-ddThh:mm:ss+0100
  • Central European Time (CET)9, used in Germany, France, Switzerland10, Belgium, Italy, Netherlands, Norway, Poland, Spain, Sweden, Denmark etc.
    • Central European Time (CET): yyyy-mm-ddThh:mm:ss+0100
    • Central European Summer Time (CEST)11: yyyy-mm-ddThh:mm:ss+0200
  • China Standard Time (CST), or Beijing Time (BJT)12
    • yyyy-mm-ddThh:mm:ss+08:00 (Daylight saving time has not been observed since 199113.)
  • Japan Standard Time (JST)14
    • yyyy-mm-ddThh:mm:ss+09:00 (Daylight saving time is not observed in this time zone.)


In closing

What is mentioned before is sufficient for me to understand above three GitHub repo timestamps. By the way, during my process of looking for information, I found some useful websites for querying time or converting date format, such as: Time.is, UTC Time Now, timeanddate.com, and Timestamp Converter.


References