timecalc

command module
v0.0.0-...-68d8a06 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2026 License: GPL-3.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Timecalc

Timecalc is a calculator for time values, i.e dates and durations. It can be used to convert values between RFC3339 dates and timestamps, add dates and durations, filter and truncate dates. Such functionality is usually available either using the python repl or a bunch of programs like date(1). Timecalc is an attempt to simplify and gather such calculations is a simple program.

Usage

$ ./timecalc
2026-10-28T14:42:39+02:00

$ ./timecalc print now
2026-10-28T14:42:39+02:00

$ ./timecalc -l utc print now
2026-10-28T12:42:45Z

$ ./timecalc -l utc add now 3h
2026-10-28T15:42:56Z

$ ./timecalc -l utc -o unix add now 3h
1793202188

$ ./timecalc -o unix 2026-10-28T00:00:00Z
1793145600

$ ./timecalc -o unixmilli 2026-10-28T00:00:00Z
1793145600000

$ ./timecalc -o unixmilli 2026-10-28T00:03:12Z
1793145792000

$ ./timecalc 1793145792000
2026-10-28T02:03:12+02:00

$ ./timecalc after now tomorrow
2026-10-29T00:00:00+02:00

$ ./timecalc -l utc after now tomorrow
2026-10-29T00:00:00Z

$ ./timecalc -l utc before now yesterday
2026-10-27T00:00:00Z

$ ./timecalc -l utc trunc now 5m
2026-10-28T12:40:00Z

$ ./timecalc diff now 15:00:00 16:00:00
14m50.907596542s
1h14m50.907596542s

$ ./timecalc gaps now 15:00:00 16:00:00
14m46.570367047s
1h0m0s

Install

Timecalc is written in go. You need the go SDK which you can install with your OS package manager or download it from here.

To install timecalc, simply

go install github.com/anastasop/timecalc@latest

License

Licensed under the 3-Clause BSD License.

Bugs

Still unsure if i should keep the lisp style commands or use infix expressions.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL