66API is a simple API built with NestJS to perform various date-related operations, such as calculating age, converting between Gregorian and Shamsi dates, and finding the difference between two dates. The API supports both GET and POST requests.
This API can be deployed and run on Vercel.
You can try out the API live at: https://66api.vercel.app/.
$ git clone https://github.com/code3-dev/66api.git
$ cd 66api$ npm install$ npm run start$ npm run start:dev$ npm run start:prod$ npm run build$ node dist/main.js-
Endpoint (GET):
http://localhost:3000/get/timeDescription: Returns the current time.
-
Endpoint (GET):
http://localhost:3000/get/imageDescription: Returns the current time as an image.
-
Endpoint (GET):
http://localhost:3000/age/gregorian?birthdate=2005-02-10Description: Calculates the age based on the provided Gregorian birthdate.
-
Endpoint (POST):
http://localhost:3000/age/gregorianRequest Header:
Content-Type: application/jsonRequest Body:
{ "birthdate": "2005-02-10" }
-
Endpoint (GET):
http://localhost:3000/age/shamsi?birthdate=1383/11/22Description: Calculates the age based on the provided Shamsi birthdate.
-
Endpoint (POST):
http://localhost:3000/age/shamsiRequest Header:
Content-Type: application/jsonRequest Body:
{ "birthdate": "1383/11/22" }
-
Endpoint (GET):
http://localhost:3000/conversion/gregorian-to-shamsi?gregorianDate=2005-02-10Description: Converts the given Gregorian date to Shamsi.
-
Endpoint (POST):
http://localhost:3000/conversion/gregorian-to-shamsiRequest Header:
Content-Type: application/jsonRequest Body:
{ "gregorianDate": "2005-02-10" }
-
Endpoint (GET):
http://localhost:3000/conversion/shamsi-to-gregorian?shamsiDate=1383/01/22Description: Converts the given Shamsi date to Gregorian.
-
Endpoint (POST):
http://localhost:3000/conversion/shamsi-to-gregorianRequest Header:
Content-Type: application/jsonRequest Body:
{ "shamsiDate": "1383/01/22" }
-
Endpoint (GET):
http://localhost:3000/diff/shamsi?startDate=1402/10/12&endDate=1403/10/12Description: Calculates the difference between two Shamsi dates.
-
Endpoint (POST):
http://localhost:3000/diff/shamsiRequest Header:
Content-Type: application/jsonRequest Body:
{ "startDate": "1402/10/01", "endDate": "1403/10/04" }
-
Endpoint (GET):
http://localhost:3000/diff/gregorian?startDate=2024-01-01&endDate=2024-12-25Description: Calculates the difference between two Gregorian dates.
-
Endpoint (POST):
http://localhost:3000/diff/gregorianRequest Header:
Content-Type: application/jsonRequest Body:
{ "startDate": "2024-01-01", "endDate": "2024-12-25" }
- All
POSTrequests should include theContent-Type: application/jsonheader. - The date format for Gregorian dates is
YYYY-MM-DD, and for Shamsi dates, it isYYYY/MM/DD.
For any queries or issues, please contact:
- Name: Hossein Pira
- Email: [email protected]
- Instagram: @h3dev.pira
- Telegram: @h3dev