[Libreoffice-bugs] [Bug 125878] Dates imported incorrectly from dbf file

2019-06-12 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=125878

Eike Rathke  changed:

   What|Removed |Added

   Assignee|libreoffice-b...@lists.free |er...@redhat.com
   |desktop.org |
 Status|NEW |ASSIGNED
Version|6.2.3.2 release |Inherited From OOo

--- Comment #6 from Eike Rathke  ---
Found the culprit, this has always been wrong..

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 125878] Dates imported incorrectly from dbf file

2019-06-12 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=125878

Julien Nabet  changed:

   What|Removed |Added

 CC||serval2...@yahoo.fr

--- Comment #5 from Julien Nabet  ---
The algo to convert Julian to Gregorian date seems corresponding to
http://mathforum.org/library/drmath/view/51907.html

lpr: since first bVisual FoxPro or just
dBase is for dBase files which has a long story (see
https://en.wikipedia.org/wiki/DBase) so the file format has changed with the
time + those who use and change it to improve it.
Since the first byte of the attached file is 0x30, it seems indeed a file
generated by Visual Fox pro (see https://www.dbf2002.com/dbf-file-format.html).


As you may have seen, depending the source, algo to convert Julian to Gregorian
date is different.

In your link, you indicated:
"There is a free tool called DBF Viewer Plus, which is great, and this is the
tool I used for exporting DBF to xlsx. I know the date displayed by this tool
is correct because it is inline with the data where it originates from. "

Do you have Visual FoxPro to confirm the date? Indeed, perhaps DBF Viewer Plus
may be buggy.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 125878] Dates imported incorrectly from dbf file

2019-06-12 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=125878

--- Comment #4 from Julien Nabet  ---
Taking a look to
http://www.independent-software.com/dbase-dbf-dbt-file-format.html, I used
online hexa editor and applied high end first:
for date: 0025840C -> 2458636
Using 2458636 in https://aa.usno.navy.mil/data/docs/JulianDate.php gives:
First June of 2019

for time: 03AA7618 -> 61503000
Using algo from the first page quoted indeed gives:
17h05m03

Perhaps we should check lcl_CalcJulDate and lcl_CalDate from
connectivity/source/drivers/dbase/DTable.cxx

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 125878] Dates imported incorrectly from dbf file

2019-06-12 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=125878

Eike Rathke  changed:

   What|Removed |Added

  Component|Calc|Base

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 125878] Dates imported incorrectly from dbf file

2019-06-12 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=125878

Eike Rathke  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

--- Comment #3 from Eike Rathke  ---
Connecting/opening the file in Base yields the same results, which makes sense
as Calc .dbf import uses Base functionality.

For the first record we have in connectivity/source/commontools/FValue.cxx
connectivity::ORowSetValue::getDateTime() for case DataType::TIMESTAMP a
css::util::DateTime aValue with

{NanoSeconds = 0, Seconds = 2, Minutes = 1025, Hours = 17, Day = 1, Month = 6,
Year = 2019, IsUTC = 0 '\000'}

from which following the Minutes = 1025 of course leads to a later date+time.

Didn't investigate why the Base routines obtain that value.

Odd enough is that 1025 minutes are exactly 17 ours and 5 minutes, 17:05, the
expected time.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 125878] Dates imported incorrectly from dbf file

2019-06-12 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=125878

--- Comment #2 from Drew Jensen  ---
(In reply to lpr from comment #1)
> Created attachment 152131 [details]
> Sample DBF file
> 
> Sample DBF file - if you try opening using DBF Viewer Plus
> (http://www.alexnolan.net/software/dbf.htm) you will see the correct
> date/time.

I can duplicate the results using the default settings for LibeOffice.

If I go to Tools->Options and under LibreOffice Calc->Calculations change the
date setting to 1/1/1904 then the date part of the field changes to what was
expected. 

However the time portion does not change.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 125878] Dates imported incorrectly from dbf file

2019-06-12 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=125878

--- Comment #1 from lpr  ---
Created attachment 152131
  --> https://bugs.documentfoundation.org/attachment.cgi?id=152131=edit
Sample DBF file

Sample DBF file - if you try opening using DBF Viewer Plus
(http://www.alexnolan.net/software/dbf.htm) you will see the correct date/time.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs