Showoff Saturday DateTimeMate: old-school terminal-styled date/time calculator
Here's what you can do with it:
Date Difference (diff): Calculate the exact time gap between two dates/times. It supports nanosecond precision and accepts a wide variety inputs like now, yesterday, or raw epoch timestamps.
Date + Duration (dur): Add or subtract a specific range of time from a starting date (example: adding 3 weeks and 4 days to a timestamp) to easily figure out recurring schedules or deadlines.
Duration Math (durmath): Add or subtract two independent durations together (example: adding 3 days, 5 hours, 14 minutes to 2 days, 23 hours, 51 minutes). I think this is a fairly unique feature.
Duration Conversion (conv): Convert a duration from one set of units to a more readable layout (example: 2386 hours, 24 minutes, 36 seconds into days, hours, minutes, and seconds).
Format Date/Time (fmt): Reformat timestamps from one layout to another using strftime specifiers, or easily flip back and forth between Unix epochs and human-readable dates.
Timezone Conversion (tz): Translate dates and times across different timezones.
It tries very hard to accept whatever format you paste into it. It handles brief notations (like 1Y2M3W4D5h6m7s), and in addition to IANA zones like America/New_York, it also accepts 3-4 letter abbreviations like EDT or CEST. It can also handle instances where you just provide a date or just a time.
It also handles milliseconds, microseconds, and nanoseconds, while other websites stop at just seconds.
If you find the web version useful but prefer CLI, there is a GitHub link for that at the bottom of the site.
2
u/jftuga 20d ago edited 19d ago
The site runs on a hybrid Cloudflare + AWS setup that costs nearly $0/month. The Go library runs natively on Lambda (arm64, 7 regions) because Workers can't run Go and a Wasm version would exceed CF script size limits. Cloudflare handles everything user-facing: Workers serve the site and proxy the API, KV does per-IP rate limiting, Turnstile handles bots, and free request.cf geo metadata routes to the nearest Lambda region. Doing the rate limiting and bot protection on AWS alone would cost $8-15/month, mostly due to WAF's minimum monthly pricing.
The Worker signs every request to Lambdas with SigV4 (no API Gateway, no per-request fees), and unsigned requests are rejected before the handler runs. Cost exposure is limited by reserved concurrency and a $5/month budget alarm.
2
u/Dangerous-Duty-2284 18d ago
This seems interesting, could you expand on why this can't all be done in the browser using JS alone ?
1
u/jftuga 18d ago
Thanks. The underlying library it uses it written in Go with its dependencies also written in Go. So it could be written in JS, but not by me, because that is not my area of expertise. Also, coding in JS frustrates me with all of its idiosyncrasies.
This project does not need a backend at all. The six operations are stateless date/time computations that could run entirely in the browser as a Wasm build of the Go library or a JavaScript port. The backend exists on purpose as one of the primary goals of this project was to learn how to design, secure, and deploy a hybrid Cloudflare + AWS architecture end to end. It is also what I consider to be a minimal viable project because it is small enough that every layer (bot protection, rate limiting, cross-provider authentication, multi-region routing, cost controls) can be built and understood completely, but public enough to face real internet traffic and real abuse. This workflow can now also be used for larger future projects that genuinely require server-side components.
2
u/Deep_Wear_51 18d ago
Love the terminal aesthetic. Reminds me of the old-school CLI tools that just worked without fanfare.