'How to get commit on a particular date using gitlabapi query?
I have seen that there is query to fetch commits using since or until in gitlabapi query. I want to fetch the response for a particular date.
Example: I want to fetch the response for a repository's commit on 2022-04-18. I have tried with the following query but the & operation didn't work curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/repository/commits?first_parent=true&since=2022-04-18&until=2022-04-18"
Response is displayed if I use: curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/repository/commits?first_parent=true&since=2022-04-18"
In this case, later dates commits are also displayed. I want to see only the commits on 2022-04-18.
Solution 1:[1]
Try to specify the until and since in ISO 8601 format.
To get a specific day you need to specify a day period e.g
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/repository/commits?first_parent=true&since=2022-04-18T00:00:00Z&until=2022-04-18T23:59:59Z"
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Tolis Gerodimos |
