import date trouble

Thomas Baumgart thb at net-bembel.de
Tue Jan 15 21:30:12 GMT 2019


Scott,

On Dienstag, 15. Januar 2019 19:58:45 CET Scott Lair wrote:

> On Tue, 15 Jan 2019 12:50:24 -0500
> Jack <ostroffjh at users.sourceforge.net> wrote:
> 
> > On 2019.01.15 10:33, Scott Lair wrote:
> > > I have the following transaction in a .qfx file downloaded from my
> > > credit union
> > > 
> > > <STMTTRN>
> > > <TRNTYPE>XFER
> > > <DTPOSTED>20181201000000
> > > <TRNAMT>-745.00
> > > <FITID>12/1/2018 12:00:00 AM
> > > <NAME>Landlord
> > > <MEMO>Withdrawal, Processed, Transfer
> > > </STMTTRN>
> > > 
> > > When I import under debian buster, currently 4.8.1 the date of the
> > > transaction in kmmoney comes out as 2018-12-01.  No problem.
> > > 
> > > When I import under windows with either 4.8.0, 4.8.1 or 4.8.2 the
> > > date gets changed to 2018-11-30.
> > > 
> > > Any idea on how I can get it to work in windows?
> > >   
> > What version of Windows, is your clock set to local or UTC, and what  
> > timezone do you have set?  I don't know if any of those will give a  
> > definitive answer, but there was an issue in the past of importing a  
> > "wrong" date.  However, as I remember, that had to do with a
> > timezone being specified in the OFX itself and not being handled
> > correctly.  I don't know if it matters, but is there a timezone
> > specified anywhere else in the OFX?
> > 
> > Jack
> > 
> 
> Windows 10. Clock is set to EST.
> 
> I don't see the timezone being set in the ofx file. Do you know the tag
> and  syntax to set it? I didn't have much luck finding it. I did try
> appending the timezone to the transaction and date came out correctly,
> but this wouldn't really work well on an ongoing basis. If I could
> simply add a one line timzone code at the top of the file, that would
> work for me.

The OFX specification is pretty clear at this point.

Elements specified as type date or datetime and generally starting with the letters “DT” accept a fully formatted date-time-timezone string. For example, “19961005132200.124[-5:EST]” represents October 5, 1996, at 1:22 and 124 milliseconds p.m., in Eastern Standard Time. This is the same as 6:22 p.m. Greenwich Mean Time (GMT). Date and datetime also accept values with fields omitted from the right. They assume the following defaults if a field is missing:

YYYYMMDD						12:00 AM (the start of the day), GMT
YYYYMMDDHHMMSS				GMT
YYYYMMDDHHMMSS.XXX		GMT

Your bank provides "<DTPOSTED>20181201000000" which represents midnight in GMT and since you are 5 hrs behing (EST) your local time for this is 2018-11-30 19:00:00. Since KMyMoney only uses the date, that is what you see.

An additional one line thingy is not OFX conform and will not be added. KMyMoney has a specific feature in a newer version to support servers in different timezones. Even if your server would provide the right timezone information for EST it is a problem if you are located in PST. Again, that 3 hour difference would cause trouble for a midnight timestamp. The feature "Allow to add a timezone offset for OFX import on account basis" made it into 5.0.2.

Not sure if the 4.8 maintainer wants to add it to the 'old' version. Here's the review of the 5.0 change:

    https://phabricator.kde.org/D13293

Hope that helps to understand the problem and the situation.

Regards

Thomas

-- 

Regards

Thomas Baumgart

https://www.signal.org/       Signal, the better WhatsApp
-------------------------------------------------------------
If you've got friends that have you thrown out of a plane in mid-air,
you don't need enemies.
(Sebas Kügler on http://vizzzion.org/blog/2010/06/jumped/)
-------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 868 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kmymoney/attachments/20190115/3e52f8be/attachment.sig>


More information about the KMyMoney mailing list