Skip to content

Views Time Ago not calculating dates "ago" correctly. #7069

@albanycomputers

Description

@albanycomputers

Description of the bug

Having a View with a Date Of Birth (DOB) date field, and using the formatted "Time ago" does not calculate the correct birthdate.

For example... a date of birth as 16th February 1944 is being shown as 82 years 4 days with an "interval" of 2.

Image

The actual birthdate should be 81 years 348 days, based on a NOW date of 30 Jan 2026

Steps To Reproduce

To reproduce the behaviour:

  1. Create a content type with a date field - add a date to the content type in the past, i.e. 16 Feb 1944
  2. Create a view and add the date field
  3. Configure the Views field as
  4. "Formatter" = "Time ago"
  5. "Display" = Time Ago
  6. "Interval" = 2

Expected behaviour

The values displayed should be 81 years 348 days

Additional information

Curtesy of @indigoxela
The function being called to calculate the date
https://github.com/backdrop/backdrop/blob/1.x/core/includes/common.inc#L2592

Possible fix
https://www.drupal.org/project/drupal/issues/2744597

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions