$datetime->elapsedTimeStr() method

Render an elapsed time string

Available since version 3.0.129.

Usage

// basic usage
$string = $datetime->elapsedTimeStr($start);

// usage with all arguments
$string = $datetime->elapsedTimeStr($start, $stop = null, $abbreviate = false, array $options = []);

Arguments

NameType(s)Description
startint, string

Starting timestamp or date/time string.

stop (optional)int, string

Ending timestamp or date/time string, or omit for now.

abbreviate (optional)bool, int, array
  • Specify boolean FALSE for verbose elapsed time string without abbreviations (default).
  • Specify boolean TRUE for abbreviations (abbreviated where common, not always different from non-abbreviated).
  • Specify integer 1 for extra short abbreviations (all terms abbreviated into shortest possible string).
  • Specify integer 0 for digital elapsed time string like “00:01:12” referring to hours:minutes:seconds.
options (optional)array

Additional options:

  • delimiter (string): String to separate time periods (default=' ').
  • exclude (array|string): Exclude these periods, one or more of: 'seconds', 'minutes', 'hours', 'days', 'weeks' (default=[])

Return value

string


$datetime methods and properties

API reference based on ProcessWire core version 3.0.200

Twitter updates

  • Weekly update for July 22– Looking back at what web development was like in the year 2000. Plus some more discussion on the path from CKEditor 4 to CkEditor 5 in ProcessWire: More
    22 July 2022
  • ProcessWire 3.0.203 core updates: new support for custom fields on comments and more— More
    15 July 2022
  • New blog: Debugging tools built-in to ProcessWire. ProcessWire's core comes with a lot of helpful debugging tools and capabilities built-in. In this post we'll cover some of these useful tools and how to use them… More
    1 July 2022

Latest news

  • ProcessWire Weekly #428
    In the 428th issue of ProcessWire Weekly we'll take a quick dive into the weekly update from Ryan, introduce a couple of brand new third party modules, and more. Read on!
    Weekly.pw / 23 July 2022
  • Debugging tools built into ProcessWire
    ProcessWire's core comes with a lot of helpful debugging tools and capabilities built-in. In this post we'll cover some of these useful tools and how to use them.
    Blog / 1 July 2022
  • Subscribe to weekly ProcessWire news

“I am currently managing a ProcessWire site with 2 million+ pages. It’s admirably fast, and much, much faster than any other CMS we tested.” —Nickie, Web developer