Bug 320790 - XtConnect - Saves e-mails into database with the UTC timezone instead of local timezone
Summary: XtConnect - Saves e-mails into database with the UTC timezone instead of loca...
Status: RESOLVED FIXED
Alias: None
Product: trojita
Classification: Applications
Component: Other (show other bugs)
Version: 0.3.93
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Trojita default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-06 00:07 UTC by Daniel Watson
Modified: 2013-06-06 21:59 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Watson 2013-06-06 00:07:19 UTC
When e-mails are imported, the date/time value is offset and saved as the UTC time instead of local time. This only happens when the date/time is pulled in from the e-mail. When the date/time cannot be determined, the current date/time is generated, but is generated in the local time zone, not UTC. So the behavior is not consistent.

Reproducible: Always

Steps to Reproduce:
1. Send an e-mail to sync account
2. Run xtconnect-trojita
3. Observe that the date/time value stored is offset.
Actual Results:  
Our timezone: US Pacific
Date/time of e-mail is 5:45 PM US Pacific
Date/time of e-mail as displayed in trojita is 3:51 PM US Pacific
Date/time of e-mail as stored in psql database is 10:51 US Pacific


Expected Results:  
Our timezone: US Pacific
Date/time of e-mail is 5:45 PM US Pacific
Date/time of e-mail as displayed in trojita is 3:51 PM US Pacific
Date/time of e-mail as stored in psql database is 3:51 PM US Pacific


Convert the time from UTC to local time.
Comment 1 Daniel Watson 2013-06-06 05:27:59 UTC
Always double check before submitting ...

The date/time values I specified were incorrect.

Steps to Reproduce:
1. Send an e-mail to sync account
2. Run xtconnect-trojita
3. Observe that the date/time value stored is offset.
Actual Results:  
Our timezone: US Pacific
Date/time of e-mail is 3:51 PM US Pacific
Date/time of e-mail as displayed in trojita e-mail client is 3:51 PM US Pacific
Date/time of e-mail as stored in psql database is 10:51 US Pacific


Expected Results:  
Our timezone: US Pacific
Date/time of e-mail is 3:51 PM US Pacific
Date/time of e-mail as displayed in trojita e-mail client is 3:51 PM US Pacific
Date/time of e-mail as stored in psql database is 3:51 PM US Pacific
Comment 2 Daniel Watson 2013-06-06 21:59:29 UTC
Git commit f97dfc26a5b078faecec59b652e0cca275be2de1 by Daniel Watson.
Committed on 06/06/2013 at 02:11.
Pushed by jkt into branch 'master'.

XtConnect - Use QDateTime consistently as UTC

Modify SQL to use ISO date string to specify that the time is UTC.

REVIEW: 110846

M  +1    -1    src/XtConnect/MailSynchronizer.cpp
M  +3    -1    src/XtConnect/SqlStorage.cpp

http://commits.kde.org/trojita/f97dfc26a5b078faecec59b652e0cca275be2de1