Date and timezone problem

Derek Atkins warlord at MIT.EDU
Mon Nov 10 10:38:19 EST 2008


Quoting Phil Longstaff <plongstaff at rogers.com>:

> On November 10, 2008 09:27:18 am Rolf Leggewie wrote:
>> Hi,
>>
>> I have entered a transaction for July 1st.  This is what it looks like
>> in the XML file.
>>
>> <trn:date-posted>
>>    <ts:date>2008-07-01 00:00:00 +0200</ts:date>
>> </trn:date-posted>
>>
>> When I save that in the SQL backend, it becomes 20080630220000.  Now
>> when I run a quarterly report on the SQL database, that transaction is
>> counted for the second quarter when it should have been counted in the
>> third.
>>
>> Anybody have an idea how things turned out the way they did?
>
> Dates are stored as UTC in the SQL backend and converted back to local time
> when the records are retrieved.  Date format is YYYYMMDDHHMMSS.  Seemed
> cleanest to me at the time, but there's been a long discussion on 
> this mailing
> list about dates/times.

To me it looks like something is getting confused, because the timestamp
2008-07-01 00:00:00 +0200 looks to me like a UTC timestamp that's slapped
with a local timezone marker..  Because this timeestamp does map
to 2008-06-30 22:00:00 UTC..

So something is doing the conversion improperly somewhere.

> Phil

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available



More information about the gnucash-devel mailing list