Useful Tip:
You can use PostMan to check if everything is okay before implementing it in the code
A free and simple date conversion API for developers to integrate it with your application in a way you see fit. The API is organized in REST architecture. And all endpoints are accessible via GET requests.
sending a GET request with month, date , year parameters at the following endpoint is enough.
http://www.geezdate.org/api/v1/toEthiopian/convert
curl "http://www.geezdate.org/api/v1/toEthiopian?convert&month=10&year=2012&date=13"
StatusCode : 200
StatusDescription : OK
Content : {
"Status": "OK",
"Data": {
"Date": 3,
"Month": "02",
"MonthName": "ጥቅምት",
"Year": 2005
}
}
sending a GET request with month, date , year parameters at the following endpoint is enough.
curl "http://www.geezdate.org/api/v1/toGregorian/convert"
curl "http://www.geezdate.org/api/v1/toGregorian?convert&month=02&year=2010&date=28 "
StatusCode : 200
StatusDescription : OK
Content : {
{
"Status": "OK",
"Data": {
"Date": 7,
"Month": "11",
"MonthName": "November",
"Year": 2017
}
}
}
this endpoint returns the current Ethiopian date
curl "http://www.geezdate.org/api/v1/today"
curl "http://www.geezdate.org/api/v1/today"
StatusCode : 200
StatusDescription : OK
Content : {
"Status":"OK",
"Data":{"Date":24,
"Month":"10",
"MonthName":"ሰኔ",
"Year":2012
}}
}
}
In case of invalid input, the API will return an ERROR status with the Error Infomation.
For example if the request has an invalid input, the "Status" in the response JSON will be "ERORR" instead of "OK". But the HTTP Status code will always be 200.
curl "http://www.geezdate.org/api/v1/toEthiopian?convert&month=15&year=2012&date=13"
StatusCode : 200
StatusDescription : OK
Content : {
{
{
"Status": "ERROR",
"Data": [],
"ErorInfo": "Invalid Date"
}
}
}
You can use PostMan to check if everything is okay before implementing it in the code
<script>
$.get(
"http://www.geezdate.org/api/v1/toGregorian/?convert",
{ month: 10, year: 2012, date:12 },
function(data){
console.log(JSON.stringify(data))
});
</script>
@Autowired
RestTemplate restTemplate;
// you can write your implimatation for Object mapping
...
...
String response = restTemplate.getForObject("http://www.geezdate.org/api/v1/toGregorian?convert&month=02&year=2010&date=28",
String.class);
If you want to help out in developeing this API further please don't hesitate to contact me