mcp-datetime
v0.3.0A MCP server for datetime formatting, timezones, Japanese era (wareki) and file name generation.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_datetime
Get the current date and time in the given format. The time is in the local timezone of the machine running the server, unless 'timezone' is given as an IANA name such as 'Asia/Tokyo' or 'UTC'. 'format' is one of the format names below, or a custom pattern containing '%'. Custom patterns accept strftime directives (%Y %m %d %H %M %S %a %A %b %B %z %Z %j ...), %-m %-d %-H %-M %-S %-I %-j %-y for no leading zero, and these Japanese directives: %Je era name (令和), %JE era initial (R), %Jy era year (元 for year 1), %JY era year (always a number), %Ja weekday (火), %JA weekday (火曜日). E…
| Parameter | Type | Description |
|---|---|---|
format * | string | Format name such as 'datetime', or a custom pattern containing '%'. See the tool description. |
timezone | IANA timezone name such as 'Asia/Tokyo', 'UTC' or 'America/New_York'. Omit to use the local timezone of the machine. |
convert_time
Convert a time or date-time from one timezone to another. Returns both sides with their timezone, UTC offset and weekday, and the time difference. A note is added when the time is skipped or repeated by a daylight saving time change. Accepted forms: '2024-12-10', '2024-12-10 14:30', '2024-12-10T14:30:00+09:00', '2024/12/10', '2024年12月10日 14時30分', Japanese era such as '令和6年12月10日' or 'R6.12.10', and a time only such as '14:30' (today).
| Parameter | Type | Description |
|---|---|---|
target_timezone * | string | IANA timezone to convert to, e.g. 'America/New_York'. |
time * | string | Time or date-time to convert, e.g. '14:30' or '2024-12-10 14:30'. |
format | string | Output format name or custom pattern, as in get_datetime. |
source_timezone | IANA timezone of 'time', e.g. 'Asia/Tokyo'. Omit to use the local timezone. An offset written in 'time' (+09:00, Z) takes precedence. |
shift_datetime
Add or subtract an amount of time to a date-time (default: now). Use negative numbers for the past. Years, months, weeks and days keep the wall time; if the day does not exist in the new month, the last day of that month is used (2024-01-31 + 1 month = 2024-02-29). Hours, minutes and seconds are elapsed time. Accepted forms: '2024-12-10', '2024-12-10 14:30', '2024-12-10T14:30:00+09:00', '2024/12/10', '2024年12月10日 14時30分', Japanese era such as '令和6年12月10日' or 'R6.12.10', and a time only such as '14:30' (today).
| Parameter | Type | Description |
|---|---|---|
base | Start date-time. Omit to start from now. | |
days | integer | |
format | string | Output format name or custom pattern, as in get_datetime. |
hours | integer | |
minutes | integer | |
months | integer | |
seconds | integer | |
timezone | IANA timezone of 'base' and of the result. Omit for local time. | |
weeks | integer | |
years | integer |
get_datetime_info
Get details of a date-time (default: now): ISO date-time, timezone, UTC offset, daylight saving time, Unix time, weekday in English and Japanese, Japanese era (wareki), day of year, ISO week, quarter, leap year, days in the month, and the difference from a reference date-time (default: now) in days and seconds, e.g. how many days until a date. Accepted forms: '2024-12-10', '2024-12-10 14:30', '2024-12-10T14:30:00+09:00', '2024/12/10', '2024年12月10日 14時30分', Japanese era such as '令和6年12月10日' or 'R6.12.10', and a time only such as '14:30' (today).
| Parameter | Type | Description |
|---|---|---|
datetime | Date-time to inspect. Omit for now. | |
reference | Date-time to compare with. Omit to compare with now. | |
timezone | IANA timezone for reading and showing the date-times. Omit for local. |