Data base problem when the year is more then 2038

Created on 13 June 2023, over 1 year ago
Updated 14 June 2023, over 1 year ago

Problem/Motivation

When the user chose a year more than 2038 is showing a SQL erro, "Numeric value out of range: 1264 Out of range value for column".
The smart date field start and end is using a type int(11) on the database, and when the year is more than 2038 the timestamp is a number out of the int range.

Steps to reproduce

Set date with year more than 2038.

Proposed resolution

Change the type to varchar.

🐛 Bug report
Status

Closed: duplicate

Version

3.6

Component

Code

Created by

🇧🇷Brazil pedrosf

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

Comments & Activities

  • Issue created by @pedrosf
  • Status changed to Closed: duplicate over 1 year ago
  • 🇨🇦Canada mandclu

    The concern was previously raised in 🐛 Far-future dates cause WSOD, "Numeric value out of range" Fixed . Drupal 10.1, due to be released in the coming days, resolves the "2038 problem" by storing timestamps as BIGINT columns instead of INT. It's worth noting that BIGINT uses less storage than storing dates as ISO 8601 strings in a VARCHAR field, and is more performant.

    I would love to provide native DATETIME storage as an even better alternative, but this would require significant work to implement. If this is something you would like to work on, however, I would gladly review a patch or merge request.

Production build 0.71.5 2024