Pluxbox Logo

DateTime relative difference block

Purpose

Get the time difference between two DateTime objects in a human-readable manner.

E.g. 'a second ago' or 'in two days'.

Input

  • Start
    DateTime object representing the starting time. Will only trigger an output, when 'stop' is also set. Is forgotten when output has been provided.

  • Stop
    DateTime object representing the end time. If it is before the start, the output will describe the differnce as 'in' instead of 'ago'. Will only trigger an output, when 'start' is also set. Is forgotten when output has been provided.

  • Locale
    Select the language used in the output. (e.g. 'da' for danish, 'en' for English or 'nl' for Dutch.)

Output

  • Value
    Text describing the time difference between start and stop. Will dynamically change the units, when the differences increases.

Example

You can use the output directly to a label or a notification as you please.

graph LR
A([15:00 20/4/2022]) --Start--> B(Get DateTime Relative Diff)
C([16:00 20/4/2022]) --Stop--> B
D(['en']) --Locale--> B
B --Value--> E(['in 1 hour'])

Caveats

--None known so far--