Time is money, but calculating it correctly is harder than it looks. Libera.Date.Api is the ultimate solution for developers building HR systems, logistics platforms, and financial applications.
Stop wrestling with leap years, timezone anomalies, and shifting public holidays. Powered by the industry-standard NodaTime engine and our proprietary Working Days System, this API delivers:
Global Awareness: Built-in support for major economies (US, UK, DE, PL, FR) with accurate holiday calendars.
Business Logic Ready: Instantly calculate SLAs and delivery dates by excluding weekends and holidays.
Precision Engineering: Get exact durations down to the minute, or broad calendar period differences (Years/Months/Days).
Smart Fallbacks: Automatically find the next available working day when deadlines hit a holiday.
All requests must be authenticated. You can use either an API Key or a Bearer Token.
| Method | Header Name | Value Format |
|---|---|---|
| API Key | X-Api-Key |
YOUR_API_KEY |
| Bearer Token | Authorization |
Bearer YOUR_JWT_TOKEN |
Base URL: http://localhost:8080 (adjust to your deployment)
Calculates the calendar difference (Years, Months, Days).
URL: /date-calculator/period/date
Method: GET
Parameters:
Start (query, required): Start date (ISO 8601, e.g., 2024-01-01)
End (query, required): End date (ISO 8601, e.g., 2025-03-15)
Request:
curl -X GET "http://localhost:8080/date-calculator/period/date?Start=2024-01-01&End=2025-03-15" \
-H "X-Secret: TEST_SECRET"
Response (200 OK):
{
"years": 1,
"months": 2,
"days": 14,
"description": "1 year, 2 months, 14 days"
}
Calculates the duration in total days, hours, and minutes.
URL: /date-calculator/period/time
Method: GET
Parameters:
Start (query): 2024-01-01T12:00:00
End (query): 2024-01-05T18:30:00
Request:
curl -X GET "<http://localhost:8080/date-calculator/period/time?Start=2024-01-01T12:00:00&End=2024-01-05T18:30:00>" \
-H "X-Secret: TEST_SECRET"
Response (200 OK):
{
"totalDays": 4,
"hours": 102,
"minutes": 6150
}
Advanced logic for business days, weekends, and public holidays.
Path Parameter: {countryCode} (e.g., PL, US, DE, UK).
Checks if a specific date is a working day. If it is not (due to weekend or holiday), it returns the date of the next immediate working day.
URL: GET /workingdays/{countryCode}/is-working-day
Parameters:
Date (required, YYYY-MM-DD)
Example Request (Checking Christmas Day in US):
bash
curl -X GET "http://localhost:8080/workingdays/US/is-working-day?Date=2025-12-25"
Response (200 OK):
json{
"date": "2025-12-25T00:00:00",
"isWorkingDay": false,
"nearestWorkingDay": "2025-12-26T00:00:00"
}
Returns detailed metadata about why a day is not a working day. It distinguishes between weekends (specifying if it's the 1st or 2nd day of the weekend) and public holidays.
URL: GET /workingdays/{countryCode}/non-working-info
Parameters:
Date (required, YYYY-MM-DD)
Example Request:
bash
curl -X GET "http://localhost:8080/workingdays/PL/non-working-info?Date=2024-05-01"
Response (200 OK):
json{
"date": "2024-05-01T00:00:00",
"isNonWorkingDay": true,
"type": "holiday",
"weekendDayNumber": null,
"holiday": {
"englishName": "Labor Day",
"localName": "Święto Pracy"
}
}
Generates a comprehensive breakdown of a date range, splitting all dates into "Working" and "Non-Working" lists. Ideal for rendering calendars or Gantt charts.
URL: GET /workingdays/{countryCode}/range
Parameters:
Start (required): Range start.
End (required): Range end.
Note: Max range is limited by server configuration (default 366 days).
Example Request:
bash
curl -X GET "http://localhost:8080/workingdays/US/range?Start=2024-07-03&End=2024-07-05"
Response (200 OK):
json{
"start": "2024-07-03T00:00:00",
"end": "2024-07-05T00:00:00",
"workingDays": [
{ "date": "2024-07-03T00:00:00" },
{ "date": "2024-07-05T00:00:00" }
],
"nonWorkingDays": [
{
"date": "2024-07-04T00:00:00",
"type": "holiday",
"englishName": "Independence Day",
"localName": "Independence Day"
}
]
}
Calculates the number of business days between two dates. (excluding weekends and holidays).
URL: /workingdays/{countryCode}/count
Method: GET
Parameters:
Start (query): 2024-05-01
End (query): 2024-05-10
Request:
curl -X GET "<http://localhost:8080/workingdays/PL/count?Start=2024-05-01&End=2024-05-10>" \
-H "X-Secret: TEST_SECRET"
Response (200 OK):
{
"totalDays": 366,
"workingDays": 253
}
Returns the count of non-working days (weekends + holidays).
URL: /workingdays/{countryCode}/off-days
Method: GET
Request:
curl -X GET "<http://localhost:8080/workingdays/PL/off-days?Start=2024-05-01&End=2024-05-10>" \
-H "X-Secret: TEST_SECRET"
Response (200 OK):
{
"totalDays": 366,
"offDays": 113
}
Returns a list of public holidays in the given range.
URL: /workingdays/{countryCode}/holidays
Method: GET
Request:
curl -X GET "<http://localhost:8080/workingdays/PL/holidays?Start=2024-01-01&End=2024-01-10>" \
-H "X-Secret: TEST_SECRET"
Response (200 OK):
[
{
"date": "2024-01-01",
"name": "New Year's Day",
"localName": "Nowy Rok"
},
{
"date": "2024-01-06",
"name": "Epiphany",
"localName": "Święto Trzech Króli"
}
]
Returns the number of weekend days (Saturdays and Sundays).
URL: /workingdays/{countryCode}/weekends
Method: GET
Request:
curl -X GET "<http://localhost:8080/workingdays/PL/weekends?Start=2024-05-01&End=2024-05-10>" \
-H "X-Secret: TEST_SECRET"
Response (200 OK):
{
"totalDays": 91,
"weekendDaysCount": 26
}
返回给定日期是否是工作日。如果不是,则返回下一个最近的工作日
工作日 - 端点功能
| 对象 | 描述 |
|---|---|
Date |
[必需] |
countryCode |
[必需] |
{"date":"2026-01-06T00:00:00","isWorkingDay":false,"nearestWorkingDay":"2026-01-07T00:00:00"}
curl --location --request GET 'https://zylalabs.com/api/11640/edit+libera+date+and+buisness+days+calculator+api/21978/is+working+day?Date=2026-01-06&countryCode=Required' --header 'Authorization: Bearer YOUR_API_KEY'
返回给定日期之后或等于的最近工作日
最近的工作日 - 端点功能
| 对象 | 描述 |
|---|---|
Date |
[必需] |
countryCode |
[必需] |
{"date":"2026-01-06T00:00:00","nearestWorkingDay":"2026-01-07T00:00:00","isSameDay":false}
curl --location --request GET 'https://zylalabs.com/api/11640/edit+libera+date+and+buisness+days+calculator+api/21981/nearest+working+day?Date=2026-01-06&countryCode=Required' --header 'Authorization: Bearer YOUR_API_KEY'
返回该天是否为非工作日,并解释它是周末(第1天/第2天)还是公共假日
非工作日信息 - 端点功能
| 对象 | 描述 |
|---|---|
Date |
[必需] |
countryCode |
[必需] |
{"date":"2026-01-06T00:00:00","isNonWorkingDay":true,"type":"holiday","weekendDayNumber":null,"holiday":{"englishName":"Epiphany","localName":"Święto Trzech Króli"}}
curl --location --request GET 'https://zylalabs.com/api/11640/edit+libera+date+and+buisness+days+calculator+api/21982/non+working+day+info?Date=2026-01-06&countryCode=Required' --header 'Authorization: Bearer YOUR_API_KEY'
返回受应用程序设置限制的日期范围内的工作日和非工作日
工作日范围 - 端点功能
| 对象 | 描述 |
|---|---|
Start |
[必需] |
End |
[必需] |
countryCode |
[必需] |
{"start":"2026-01-01T00:00:00","end":"2026-01-31T00:00:00","workingDays":[{"date":"2026-01-02T00:00:00"},{"date":"2026-01-05T00:00:00"},{"date":"2026-01-07T00:00:00"},{"date":"2026-01-08T00:00:00"},{"date":"2026-01-09T00:00:00"},{"date":"2026-01-12T00:00:00"},{"date":"2026-01-13T00:00:00"},{"date":"2026-01-14T00:00:00"},{"date":"2026-01-15T00:00:00"},{"date":"2026-01-16T00:00:00"},{"date":"2026-01-19T00:00:00"},{"date":"2026-01-20T00:00:00"},{"date":"2026-01-21T00:00:00"},{"date":"2026-01-22T00:00:00"},{"date":"2026-01-23T00:00:00"},{"date":"2026-01-26T00:00:00"},{"date":"2026-01-27T00:00:00"},{"date":"2026-01-28T00:00:00"},{"date":"2026-01-29T00:00:00"},{"date":"2026-01-30T00:00:00"}],"nonWorkingDays":[{"date":"2026-01-01T00:00:00","type":"holiday","englishName":"New Year's Day","localName":"Nowy Rok"},{"date":"2026-01-03T00:00:00","type":"weekend","weekendDayNumber":1},{"date":"2026-01-04T00:00:00","type":"weekend","weekendDayNumber":2},{"date":"2026-01-06T00:00:00","type":"holiday","englishName":"Epiphany","localName":"Święto Trzech Króli"},{"date":"2026-01-10T00:00:00","type":"weekend","weekendDayNumber":1},{"date":"2026-01-11T00:00:00","type":"weekend","weekendDayNumber":2},{"date":"2026-01-17T00:00:00","type":"weekend","weekendDayNumber":1},{"date":"2026-01-18T00:00:00","type":"weekend","weekendDayNumber":2},{"date":"2026-01-24T00:00:00","type":"weekend","weekendDayNumber":1},{"date":"2026-01-25T00:00:00","type":"weekend","weekendDayNumber":2},{"date":"2026-01-31T00:00:00","type":"weekend","weekendDayNumber":1}]}
curl --location --request GET 'https://zylalabs.com/api/11640/edit+libera+date+and+buisness+days+calculator+api/21983/workingdays++range?Start=2026-01-01&End=2026-01-31&countryCode=Required' --header 'Authorization: Bearer YOUR_API_KEY'
工作日数量 - 端点功能
| 对象 | 描述 |
|---|---|
Start |
[必需] |
End |
[必需] |
countryCode |
[必需] |
{"totalDays":366,"workingDays":251}
curl --location --request GET 'https://zylalabs.com/api/11640/edit+libera+date+and+buisness+days+calculator+api/21973/workingdays+count?Start=2025-01-01&End=2026-01-01&countryCode=Required' --header 'Authorization: Bearer YOUR_API_KEY'
休息日 - 端点功能
| 对象 | 描述 |
|---|---|
Start |
[必需] |
End |
[必需] |
countryCode |
[必需] |
{"totalDays":366,"offDays":115}
curl --location --request GET 'https://zylalabs.com/api/11640/edit+libera+date+and+buisness+days+calculator+api/21975/off-days?Start=2025-01-01&End=2026-01-01&countryCode=Required' --header 'Authorization: Bearer YOUR_API_KEY'
周末计数 - 端点功能
| 对象 | 描述 |
|---|---|
Start |
[必需] |
End |
[必需] |
countryCode |
[必需] |
{"totalDays":366,"weekendDaysCount":104}
curl --location --request GET 'https://zylalabs.com/api/11640/edit+libera+date+and+buisness+days+calculator+api/21976/weekend+count?Start=2025-01-01&End=2026-01-01&countryCode=Required' --header 'Authorization: Bearer YOUR_API_KEY'
返回指定日期范围内给定国家的所有公共假期列表
公众假期 - 端点功能
| 对象 | 描述 |
|---|---|
Start |
[必需] |
End |
[必需] |
countryCode |
[必需] |
{"count":15,"holidays":[{"date":"2025-01-01T00:00:00","englishName":"New Year's Day","localName":"Nowy Rok"},{"date":"2025-01-06T00:00:00","englishName":"Epiphany","localName":"Święto Trzech Króli"},{"date":"2025-04-20T00:00:00","englishName":"Easter Sunday","localName":"Wielkanoc"},{"date":"2025-04-21T00:00:00","englishName":"Easter Monday","localName":"Drugi Dzień Wielkanocy"},{"date":"2025-05-01T00:00:00","englishName":"May Day","localName":"Święto Pracy"},{"date":"2025-05-03T00:00:00","englishName":"Constitution Day","localName":"Święto Narodowe Trzeciego Maja"},{"date":"2025-06-08T00:00:00","englishName":"Pentecost","localName":"Zielone Świątki"},{"date":"2025-06-19T00:00:00","englishName":"Corpus Christi","localName":"Boże Ciało"},{"date":"2025-08-15T00:00:00","englishName":"Assumption Day","localName":"Wniebowzięcie Najświętszej Maryi Panny"},{"date":"2025-11-01T00:00:00","englishName":"All Saints' Day","localName":"Wszystkich Świętych"},{"date":"2025-11-11T00:00:00","englishName":"Independence Day","localName":"Narodowe Święto Niepodległości"},{"date":"2025-12-24T00:00:00","englishName":"Christmas Eve","localName":"Wolna Wigilia"},{"date":"2025-12-25T00:00:00","englishName":"Christmas Day","localName":"Boże Narodzenie"},{"date":"2025-12-26T00:00:00","englishName":"St. Stephen's Day","localName":"Drugi Dzień Bożego Narodzenia"},{"date":"2026-01-01T00:00:00","englishName":"New Year's Day","localName":"Nowy Rok"}]}
curl --location --request GET 'https://zylalabs.com/api/11640/edit+libera+date+and+buisness+days+calculator+api/21977/public+holidays?Start=2025-01-01&End=2026-01-01&countryCode=Required' --header 'Authorization: Bearer YOUR_API_KEY'
| 标头 | 描述 |
|---|---|
授权
|
[必需] 应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。 |
无长期承诺。随时升级、降级或取消。 免费试用包括最多 50 个请求。
每个端点返回针对特定日期计算的JSON数据。例如“计算工作日”端点返回两个日期之间的总工作日数量,而“列出公共假期”端点提供指定范围内假期的详细信息
关键字段因端点而异。例如,“获取休假天数”端点返回“totalDays”和“offDays”,而“获取详细非工作信息”则包括“date”、“isNonWorkingDay”和“holiday”详细信息,如“englishName”和“localName”
参数因端点而异。例如,“检查工作日”端点需要“日期”参数,而“分析范围”端点需要“开始”和“结束”日期。每个参数必须遵循特定格式,例如日期的格式为YYYY-MM-DD
响应数据采用JSON格式结构,通常包含一个主要对象和相关字段。例如,“分析范围”端点返回“工作日”和“非工作日”,它们是日期对象的数组,易于解析和使用
该API利用行业标准的NodaTime引擎和专有算法确保准确的日期计算。公共假期和周末的数据来自超过100个国家的可靠国家日历
常见的用例包括计算服务水平协议 规划交付日程和管理人力资源名单 例如 企业可以使用“计算工作日”接口来确定截止日期 同时考虑假期和周末
用户可以通过指定日期范围和国家代码等参数来自定义请求。例如,在使用“列出公共假期”端点时,用户可以定义“开始”和“结束”日期,以检索与其特定时间范围相关的假期
用户可以利用结构化的JSON响应将日期计算集成到应用程序中。例如“获取周末数量”响应可以用于通过在调度软件中考虑非工作日来调整项目时间表
“请假天数统计”接口提供指定日期范围内的非工作日总数,包括周末和公共假期。 这有助于企业了解在特定期间内可能的停工时间
您可以使用“检查工作日和查找最近工作日”接口。通过提供一个日期,API将返回该日期是否为工作日,如果不是,将返回最近的下一个工作日,以便于有效的调度
“分析范围”端点允许您分析最多366天的日期范围,具体由服务器设置配置。这对于生成一整年的工作日和非工作日列表非常有用
该API内置对100多个国家的支持,利用可靠的国家日历准确反映公共假期。这确保了商业日的计算是精确的,并且与指定国家相关
响应包括“日期”“isWorkingDay”(布尔值)和“nearestWorkingDay”(日期)等字段 此结构允许用户快速评估日期的状态并进行相应的计划
使用“列出公共假日”端点,通过指定国家代码和所需的日期范围。响应将包括一个假日数组,详细说明每个假日的日期和名称,这对于规划非工作日至关重要
此端点返回有关特定日期为何为非工作日的详细元数据,包括它是否为周末或公共假期,以及假期的英文和当地语言名称,提高用户的清晰度
“计算工作日”端点返回两个日期之间的工作日总数,不包括周末和节假日。这些数据可以用来设定现实的截止日期和有效管理项目时间线
服务级别:
100%
响应时间:
454ms
服务级别:
100%
响应时间:
353ms
服务级别:
100%
响应时间:
270ms
服务级别:
100%
响应时间:
434ms
服务级别:
100%
响应时间:
157ms
服务级别:
100%
响应时间:
480ms
服务级别:
100%
响应时间:
189ms
服务级别:
100%
响应时间:
1,366ms
服务级别:
100%
响应时间:
246ms
服务级别:
100%
响应时间:
282ms