Bug 167591 - LibbreOffice BASE Problem Conversion Number to Date
Summary: LibbreOffice BASE Problem Conversion Number to Date
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
24.2.5.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:26.2.0 target:25.8.1
Keywords:
: 102945 122140 152021 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-07-19 09:40 UTC by Tomaz
Modified: 2025-08-10 09:17 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot_conversion table (18.90 KB, image/png)
2025-07-19 09:40 UTC, Tomaz
Details
Copie écran 01 (70.78 KB, image/png)
2025-07-19 12:31 UTC, Tomaz
Details
Copie écran N°2 (51.19 KB, image/png)
2025-07-19 12:33 UTC, Tomaz
Details
la Base de données exemple (4.52 KB, application/vnd.sun.xml.base)
2025-07-19 12:34 UTC, Tomaz
Details
BDD DATE (3.08 KB, application/vnd.sun.xml.base)
2025-07-19 13:02 UTC, Tomaz
Details
How to build the table (43.55 KB, image/png)
2025-07-19 13:03 UTC, Tomaz
Details
What's the f...k (80.44 KB, image/png)
2025-07-19 13:04 UTC, Tomaz
Details
not yet (128.86 KB, application/pdf)
2025-07-19 13:41 UTC, Tomaz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomaz 2025-07-19 09:40:59 UTC
Created attachment 201899 [details]
Screenshot_conversion table

Bonjour
le problème que je vous présente:
dans le logiciel LIBREOFFICE (et pas que celui-là) il y a possibilité de conversion d'un nombre en date (et inversement)
mais il ya un différence entre BASE et CALC
voici un petit tableau qui est beaucoup plus parlant qu'un long discours
en Gros la conversion du zéro(0) est ok
dans le module CALC la suite est Bonne
dans BASE la conversion du zéro(0) est ok = 30/12/1899
puis la conversion du un(1) n'est plus bonne = 29/12/1899
puis le deux(2) est donc converti avec deux jours d'écart = 30/12/1899
que pouvez vous faire s'il vous plait

Hello,
The problem I'm presenting to you:
In the LIBREOFFICE software (and not only that one), it's possible to convert a number into a date (and vice versa)
But there's a difference between BASE and CALC.
Here's a small table that speaks volumes.
Basically, the conversion of zero (0) is OK.
In the CALC module, the rest is OK.
In BASE, the conversion of zero (0) is OK = 12/30/1899.
Then the conversion of one (1) is no longer OK = 12/29/1899.
Then the two (2) is therefore converted with a two-day gap = 12/30/1899.
What can you do, please?
Comment 1 Mike Kaganski 2025-07-19 09:55:55 UTC
(In reply to Tomaz from comment #0)
> Here's a small table that speaks volumes.

:-) Maybe; but when I tried to check how you did your conversion in Base, that table kept silent ;-)

An ODB would be nice.
Comment 2 Tomaz 2025-07-19 12:31:21 UTC Comment hidden (obsolete)
Comment 3 Tomaz 2025-07-19 12:33:31 UTC Comment hidden (obsolete)
Comment 4 Tomaz 2025-07-19 12:34:11 UTC Comment hidden (obsolete)
Comment 5 Tomaz 2025-07-19 12:40:09 UTC Comment hidden (obsolete)
Comment 6 Mike Kaganski 2025-07-19 12:46:49 UTC Comment hidden (obsolete)
Comment 7 Tomaz 2025-07-19 13:01:15 UTC Comment hidden (obsolete)
Comment 8 Tomaz 2025-07-19 13:02:24 UTC
Created attachment 201905 [details]
BDD DATE

Nouvelle BDD
Comment 9 Tomaz 2025-07-19 13:03:11 UTC
Created attachment 201906 [details]
How to build the table
Comment 10 Tomaz 2025-07-19 13:04:07 UTC
Created attachment 201907 [details]
What's the f...k
Comment 11 Tomaz 2025-07-19 13:06:32 UTC
je me suis mal exprimé mais voici une petite idée de mon désarroi
faite une base de données avec un champs DATE
mettez lui une condition du genre je veux que par défaut la date est le 19/11/1969 (qui correspond au 25526)
et là .... surprise soit vous avez une date décalée de 2 jours soit vous avez une réponse non compréhensible

I expressed myself poorly, but here's a small idea of my dismay.
Create a database with a DATE field.
Give it a condition like "I want the default date to be 11/19/1969 (which corresponds to 25526).
And then... surprise, either you get a date that's off by 2 days or you get an incomprehensible answer.
Comment 12 Mike Kaganski 2025-07-19 13:08:55 UTC
I don't see what you see. But can you test with a new version, e.g. 25.2.5?
Comment 13 Tomaz 2025-07-19 13:10:32 UTC
Yes i tested it with the newest version and it's the same
i don't inderstand
Comment 14 Mike Kaganski 2025-07-19 13:22:07 UTC
Aha. So the problem is the default value for a date column; and the table that speaks volumes was a red herring; as usual, a clear "I do this, see this, and expect this" is much better.

Steps 1:

1. In your table design view, type any unambiguous date (preferably in ISO format, to avoid ambiguities imposed by stubborn 2-digit year formats, like 2025-07-19);
2. Click Save in the toolbar;
3. Check that the date is changed to a different date.

Steps 2:

4. With some date set as the default, open the table, and check the date shown in the new record.

I don't know how step 4 is actually expected to work - but steps 1 - 3 are definitely a bug.
Comment 15 Tomaz 2025-07-19 13:41:17 UTC
Created attachment 201908 [details]
not yet

Merci beaucoup
mais il y a bien un défaut 
même en appliquant ce process il reste encore que si la date par défaut est au bon format 1969-11-19 elle se transforme tout de suite en 1969-11-
je m'arrache les cheveux car la seule réponse serait de ne pas mettre de contrainte ?

Thank you very much,
but there is definitely a flaw.
Even if you apply this process, the default date is still in the correct format, 1969-11-19, but it immediately changes to 1969-11.
I'm tearing my hair out because the only solution would be to not set any constraints.
Comment 16 Tomaz 2025-07-19 13:42:01 UTC
read 1969-11-23
Comment 17 Mike Kaganski 2025-07-19 14:26:44 UTC
(In reply to Tomaz from comment #15)

Did you read what I wrote? I said: "3. Check that the date is changed to a different date", and "but steps 1 - 3 are definitely a bug". What are you trying to say?
Comment 19 Commit Notification 2025-07-21 06:18:30 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/060775489a42d5489417b8a5c29c8f0b4006f796

tdf#167591: Only apply date correction, when sDefault wasn't date string

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 20 Commit Notification 2025-07-21 06:18:33 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5b808448dc79e996efa7cb5082145d4e5803daa6

Related: tdf#167591 Make STANDARD_DB_DATE more standard

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 21 Commit Notification 2025-07-21 06:18:35 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3b22e7c3aa0e601e5fae4716e4e354f07e07b05f

tdf#167591: Convert date string to date early

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 22 Mike Kaganski 2025-07-27 16:20:14 UTC
*** Bug 102945 has been marked as a duplicate of this bug. ***
Comment 23 Mike Kaganski 2025-07-27 16:22:40 UTC
*** Bug 122140 has been marked as a duplicate of this bug. ***
Comment 24 Mike Kaganski 2025-07-27 16:23:10 UTC
*** Bug 152021 has been marked as a duplicate of this bug. ***
Comment 25 Robert Großkopf 2025-07-30 08:37:07 UTC
This fix also fixes bug 96190 and part of bug 88560. Could it be back ported to LO 25.8.?
Comment 26 Commit Notification 2025-08-10 09:17:07 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

https://git.libreoffice.org/core/commit/ff73678db107abc1038cfe396e5cd9350e8d7a3c

tdf#167591: Only apply date correction, when sDefault wasn't date string

It will be available in 25.8.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 27 Commit Notification 2025-08-10 09:17:09 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

https://git.libreoffice.org/core/commit/86c9b2166ab66882563839f06a8478b85274b109

Related: tdf#167591 Make STANDARD_DB_DATE more standard

It will be available in 25.8.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 28 Commit Notification 2025-08-10 09:17:12 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

https://git.libreoffice.org/core/commit/e6f843c1c5c2cb075ff0ae358735c5801e56f51f

tdf#167591: Convert date string to date early

It will be available in 25.8.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.