DateTime Tool
Overview
DateTime Tool is a Dify plugin that provides date and time manipulation utilities
with Japanese holiday support. It includes tools for relative date calculation,
month boundary detection, and Japanese holiday checking.
Features
- Relative Date Calculation: Add or subtract days, weeks, months, or years
from a date
- Business Day Support: Skip weekends and Japanese public holidays when
calculating dates
- Month Boundaries: Get the first or last day of any month
- Japanese Holiday Check: Determine if a date is a Japanese public holiday
or business day
- Timezone Support: All tools support configurable timezones (default:
Asia/Tokyo)
Tools
1. Add Duration to Date ()
Calculate a future or past date by adding or subtracting a duration from a base
date.
Parameters:
- (required): Base date in format
- (required): Number of units to add (use negative values to subtract)
- (required): , , , or
- (optional, default: ): When and unit is
, only count business days (skips weekends and Japanese public holidays)
- (optional, default: ): Timezone name
Output:
Example:
2. Get Month Start/End ()
Get the first or last day of a month.
Parameters:
- (optional): Reference date in format (defaults to today)
- (required): (first day) or (last day)
- (optional, default: ): Timezone name
Output:
Example:
3. Check Japanese Holiday ()
Check if a date is a Japanese public holiday or business day.
Uses the official Japanese Cabinet Office holiday data, fetched and cached
locally for 24 hours.
Parameters:
- (optional): Date to check in format (defaults to today)
- (optional, default: ): Timezone name
Output:
Example:
Common Use Cases
1. Calculate Deadline
Calculate a deadline N business days from today:
2. Get This Month's Boundaries
Get the start and end of the current month:
3. Check Before Scheduling
Verify a date is a business day before scheduling:
Requirements
- Python: 3.12 or higher
- Dify Version: Compatible with Dify plugin system
- Dependencies: pytz, python-dateutil, requests (automatically installed)
Privacy
See PRIVACY.md [blocked] for privacy and data handling information.
Contributing
For bug reports or feature requests, please contact the author: cazziwork
Changelog
Version 0.0.1
- Initial release
- Tools: , ,
- Japanese holiday data from Cabinet Office (cached 24 hours)
- Business day mode in