date_increment_round() and month crossover

Created on 2 May 2015, over 9 years ago
Updated 28 November 2023, 12 months ago

I imported some timestamped date fields using the Migrate module. The timestamps were set to five minutes before the end of the month.

The new Drupal site has date fields with interval of 15 minutes. I noticed that the dates were off and traced the problem to date_increment_round().
It does not account for the rounding into the next month. It passes a nonsense value (32 days) to date_date_set() which outputs an incorrect date.
Example, when the value is 2018-07-31 23:55:55 it is rounded to 2018-09-01 00:00:00.

Included patch accounts for monthly crossover

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024