AnswerDotAI / AnswerDotAI/ghapi

Wrong creation date being fetched for github repo using repos.get(owner, repo): Get a repository

Open
#108 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
685
Forks
70
Avg merge
1m
Merged PRs (30d)
2

Description

Hi All,

I wanted to get the date on which a github repository is created. However the date which I am getting is not corrrect, for example the repo https://github.com/pandas-dev/pandas/, the intial commit date is 31 Jul 2009, however it is shown as 2010-08-24 by the api.

Following is the code that I have used.
------------------------------------------------------------------------------------------------------------------
from ghapi.all import GhApi
from configparser import ConfigParser

config_parser = ConfigParser()
config_parser.read("config.ini")
access_token = config_parser["public"].get("access_token")

gh = GhApi(owner="pandas-dev", repo="pandas", token=access_token)

y = gh.repos.get(owner="pandas-dev", repo="pandas")

print(f"Creation date = {y['created_at']}")

The output is:

Creation date = 2010-08-24T01:37:33Z

-------------------------------------------------------------------------------------------

This creation date is not correct, please let me know how to fetch the correct creation date of the Github repo or date of the intial commit.

Thanks

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.