API 2.0 commits resource should return original localized timestamp commit date (BB-14097)

XMLWordPrintable

      API 2.0 commits resource (api/2.0/repositories/

      {account}

      /

      {repo}

      /commits/) always returns UTC date.

      According to the API 2.0 documentation https://confluence.atlassian.com/display/BITBUCKET/Version+2#Version2-StandardISO-8601timestamps the original localized timestamp should be returned in this case.

      Original localized timestamp is very important for our Awesome Graphs add-on for Bitbucket where UTC timestamps aren't suitable for building the punchcard graph

      Example:
      Original commit timestamp: Mon Aug 17 14:23:31 2015 +0300
      Commits API resource response date is in UTC: 2015-08-17T11:23:31+00:00
      See example details below.

      Example details:
      git log:

      #!bash
      commit e30f5dcc5837494dea213d0344952cd0542b2c91
      Author: Dmitry Zagorovsky <dzagorovsky@stiltsoft.com>
      Date:   Mon Aug 17 14:23:31 2015 +0300
      
          ts test
      

      https://bitbucket.org/api/2.0/repositories/dimatestapp/git-bra/commits?pagelen=1\\
      returns

      #!json
      
      {
        "pagelen": 1,
        "values": [
          {
            "hash": "e30f5dcc5837494dea213d0344952cd0542b2c91",
            "repository": {
              "links": {
                "self": {
                  "href": "https://bitbucket.org/!api/2.0/repositories/dimatestapp/git-bra"
                },
                "html": {
                  "href": "https://bitbucket.org/dimatestapp/git-bra"
                },
                "avatar": {
                  "href": "https://bitbucket.org/dimatestapp/git-bra/avatar/16/"
                }
              },
              "type": "repository",
              "name": "git-bra",
              "full_name": "dimatestapp/git-bra",
              "uuid": "{22e2edc7-89ca-410f-85e4-3e291dc90f06}"
            },
            "links": {
              "self": {
                "href": "https://bitbucket.org/!api/2.0/repositories/dimatestapp/git-bra/commit/e30f5dcc5837494dea213d0344952cd0542b2c91"
              },
              "comments": {
                "href": "https://bitbucket.org/!api/2.0/repositories/dimatestapp/git-bra/commit/e30f5dcc5837494dea213d0344952cd0542b2c91/comments"
              },
              "patch": {
                "href": "https://bitbucket.org/!api/2.0/repositories/dimatestapp/git-bra/patch/e30f5dcc5837494dea213d0344952cd0542b2c91"
              },
              "html": {
                "href": "https://bitbucket.org/dimatestapp/git-bra/commits/e30f5dcc5837494dea213d0344952cd0542b2c91"
              },
              "diff": {
                "href": "https://bitbucket.org/!api/2.0/repositories/dimatestapp/git-bra/diff/e30f5dcc5837494dea213d0344952cd0542b2c91"
              },
              "approve": {
                "href": "https://bitbucket.org/!api/2.0/repositories/dimatestapp/git-bra/commit/e30f5dcc5837494dea213d0344952cd0542b2c91/approve"
              }
            },
            "author": {
              "raw": "Dmitry Zagorovsky <dzagorovsky@stiltsoft.com>",
              "user": {
                "username": "dzagorovsky",
                "display_name": "Dmitry Zagorovsky",
                "type": "user",
                "uuid": "{f3825b7d-bb38-4bfc-bd22-f994514b4d35}",
                "links": {
                  "self": {
                    "href": "https://bitbucket.org/!api/2.0/users/dzagorovsky"
                  },
                  "html": {
                    "href": "https://bitbucket.org/dzagorovsky/"
                  },
                  "avatar": {
                    "href": "https://bitbucket.org/account/dzagorovsky/avatar/32/"
                  }
                }
              }
            },
            "parents": [
              {
                "hash": "3c1906afa83bc9d1384d72a027812a10f4298ba6",
                "type": "commit",
                "links": {
                  "self": {
                    "href": "https://bitbucket.org/!api/2.0/repositories/dimatestapp/git-bra/commit/3c1906afa83bc9d1384d72a027812a10f4298ba6"
                  },
                  "html": {
                    "href": "https://bitbucket.org/dimatestapp/git-bra/commits/3c1906afa83bc9d1384d72a027812a10f4298ba6"
                  }
                }
              }
            ],
            "date": "2015-08-17T11:23:31+00:00",
            "message": "ts test\n",
            "type": "commit"
          }
        ],
        "page": 1,
        "next": "https://bitbucket.org/api/2.0/repositories/dimatestapp/git-bra/commits?pagelen=1&page=2"
      }
      

        1. 838077040-Commits-1.jpg
          838077040-Commits-1.jpg
          135 kB
        2. 2530929183-Punchcard.jpg
          2530929183-Punchcard.jpg
          122 kB

            Assignee:
            Unassigned
            Reporter:
            Dmitry Zagorovsky [StiltSoft]
            Votes:
            8 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: