Content last modified Monday 6 March 2017
hop to #bottom
Categories:
Author:
Current version:
0.22
About It:
Get it:
Rate it:
  • Helpful?
  • 1 Yes
  • 0 No
Flag it:
Contact Reason [ ? ]

fha_time_diff

It takes a certain date specified in parts (i. e. year, month, hour etc.) and spills out a ‘time since’ information for the event, both past and future.

If some units are not provided, no values for these units are returned either. Some examples:

  • <txp:fha_time_diff year="2004" month="3" day="23" hour="2" minute="40" />
    Returns a complete time information, from years to minutes.

  • <txp:fha_time_diff year="2000" month="10" />
    Returns months and years since October 2000.

  • <txp:fha_time_diff year="1980" month="5" day="1" />
    Returns years, months and days since May 1, 1980.

  • <txp:fha_time_diff year="1975" />
    Only returns years since 1975.

Additionally, these arguments can be passed to the plugin. (You don’t need them for basic use with English language.)

  • lang=""
    Sets a language (two chars) for unit words; see plugin source for languages provided (sofar Czech and English only) and hints on how to add others. If not set, the plugin tries the site wide language setting, otherwise ‘en’ is assumed.

  • simpleplurals=""
    If set to a non-zero number, it indicates which amount triggers the plural form (e. g. ‘years’ instead of ‘year’). If set to zero, it turns on special word forms handling that always follows the last digit (e. g. necessary for Czech dates). If not set, it defaults to a language-specific value (2 for English, 0 for Czech).

  • delimiter=""
    Sets characters that should separate individual values. If not set, a comma with a space are assumed.

The plugin is based upon a script written by Mark H. Kathmann.

Article Request Count:

Archived [?]: other

Initially released:
2004-04-17
Posted here:
28 Nov 2004
Article modified:
28 Nov 2004

You may want to leave your comments/questions at the Forum thread for quicker feedback. Otherwise, comment away:

Your comment will NOT be submitted until you click the 'Submit' button on the next pageload.

Commented (1)

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

You know you want to visit the Archives.

Browse

Categories


Articles

There are also tag clouds, 'cause those are fun.
Published with Textpattern