Fork of alexmerkel/alfred-datetime-format-converter with additional functionality
Alfred workflow for converting between timestamps and formatted datetime strings with ease.
Download the latest release from the releases page.
Simply type df followed by:
now- current timestamp- A UTC unix timestamp (seconds or milliseconds)
- A formatted datetime string (with or without milliseconds, assumed UTC)
- ISO 8601 format with milliseconds and Z suffix (e.g.,
2026-01-19T08:22:24.709Z) - A datetime string with timezone offset (e.g.,
2026-02-13 18:00:00+00:00) - NEW:
now - interval 1 day- time arithmetic with intervals - NEW:
now + 3 hoursornow + 2h- add or subtract time using verbose or Prometheus-style syntax
This will present you with the parsed date in various formats ready to copy to your clipboard.
df now
df 1364302555
df 1737379200000
df 2013-01-15 19:41:06
df 2026-01-16 10:19:55
df 2026-01-16 10:19:55.000
df 2026-01-19T08:22:24.709Z
df 2026-02-13 18:00:00+00:00
df now - 1 day
df now - interval 3 hours
df now + 2 weeks
df now - 2h
df now + 3w
df 1364302555 - 1 hour
df 2026-01-16 10:19:55 - 2 days
df 2026-01-16 10:19:55 - 30m
You can define your timezone variable in Alfred workflow variables:
- Name:
timezone - Value: pytz timezone string (e.g.,
US/Eastern,Europe/London)
If the variable is not set, UTC is used by default.
- ISO 8601 with milliseconds: Full support for parsing and outputting ISO 8601 format with milliseconds (e.g.,
2026-01-19T08:22:24.709Z) - Timezone-offset input: Parse datetime strings with explicit UTC offset (e.g.,
2026-02-13 18:00:00+00:00) - Millisecond precision: Output formats now include millisecond precision timestamps and formatted strings
- ISO 8601 timezone offset output: Two additional output formats with
+00:00offset (2026-02-20T13:18:52+00:00and2026-02-20T13:18:52.000+00:00) - Interval arithmetic: Add or subtract time from dates using natural language or Prometheus-style syntax
- Verbose:
now - 1 day,now - interval 3 hours - Prometheus-style:
now - 2h,now + 3w,2026-01-16 10:19:55 - 30m - Supported units:
s,m,h,d,w(or verbose: seconds, minutes, hours, days, weeks)
- Verbose:
- Millisecond timestamp copy fix: The millisecond timestamp can now be properly copied to clipboard
- Zero external dependencies: Rewritten to use only Python standard library (no pytz, delorean, etc.)
This project uses uv for Python dependency management and pytest for testing.
- uv
- Python 3.8+
The workflow itself has zero runtime dependencies (only Python stdlib), but development requires pytest.
# Install dependencies
uv sync
# Build the workflow
make workflow
# Install to Alfred (requires alfred_preferences environment variable)
make installmake sync- Install dependencies with uvmake vendor- Vendor dependencies into workflow directorymake test- Run the test suitemake workflow- Build the .alfredworkflow filemake install- Install to your Alfred preferencesmake clean- Clean build artifacts
Run tests with:
make test
# or directly with uv
uv run pytest tests/ -vTests run automatically in CI before each release.
Note: pytest is a dev dependency only and is not included in the workflow bundle.
This workflow uses only Python's standard library (datetime, timedelta, timezone, re, calendar) with no external dependencies. The workflow is extremely lightweight at ~11KB.
This fork is based on the excellent work by:
- Michael Waterfall - Original workflow
- Alex Merkel - Python 3 compatibility
Uses Alfred Python by Jan Müller (Apache 2.0 License)
Copyright (c) 2013 Michael Waterfall, published under the MIT License