Code tool

Relative Time Phrases

Choose a duration and direction to create a clear relative-time phrase.

In-browser processingNo account requiredPrivacy details ↗

Enter a non-negative amount.

A QUICK WALKTHROUGH

How to use this tool

  1. Enter a non-negative duration.
  2. Choose its unit and whether it is past or future.
  3. Generate the localized phrase.

Explicit direction

Past and future are separate choices; zero is shown as an immediate phrase.

Fixed units

Months use 30 days and years use 365 days for deterministic local output.

GOOD TO KNOW

Common questions

Does this call a service?

No. The phrase is generated in your browser.