Bug 160979 - Dolphin shows time information in UTC and not in locale timezone
Summary: Dolphin shows time information in UTC and not in locale timezone
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 16.12.2
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Peter Penz
URL:
Keywords:
: 157534 159309 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-04-18 16:27 UTC by Martin Flöser
Modified: 2008-06-04 22:21 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot showing the difference in change time in dolphin and terminal (138.56 KB, image/png)
2008-04-18 16:28 UTC, Martin Flöser
Details
Make KFileItem return time in local zone (1.60 KB, patch)
2008-04-20 19:54 UTC, Jakub Stachowski
Details
kfileitem.cpp patch with cache - untested, except for compilation (2.29 KB, patch)
2008-04-21 19:20 UTC, David Faure
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Flöser 2008-04-18 16:27:51 UTC
Version:            (using Devel)
Installed from:    Compiled sources

Dolphin does not honour the local time zone for change time and last access time, but the UTC time is shown.
That is if I create a file at 14:00 CEST it will have a change time of 12:00 as this is the UTC time. This can be very confusing when sorting files by date and looking for a file you just changed.

The terminal (ls) is getting this issue correctly. I will attach a screenshot showing both dolphin and terminal for the same files. You will see that dolphin has the UTC time stamp while ls shows the local time zone time stamp.
Comment 1 Martin Flöser 2008-04-18 16:28:57 UTC
Created attachment 24385 [details]
Screenshot showing the difference in change time in dolphin and terminal
Comment 2 Jakub Stachowski 2008-04-20 19:54:34 UTC
Created attachment 24449 [details]
Make KFileItem return time in local zone
Comment 3 Jakub Stachowski 2008-04-20 19:56:37 UTC
This is because KFileItem returns UTC time, which is propagated to dolphin, open file dialog, property page. Is there any reason for this behaviour?
Comment 4 Peter Penz 2008-04-20 23:28:59 UTC
@Jakub:
> This is because KFileItem returns UTC time, which is propagated
> to dolphin, open file dialog, property page.
> Is there any reason for this behaviour? 

Thanks for the patch! I don't know honestly speaking, but if David does not object I'd say that this patch should be committed.
Comment 5 David Faure 2008-04-21 19:19:15 UTC
This is just a porting issue; we didn't have timezone-aware KDateTime  previously. I see that time_t is defined as UTC time, so indeed those KDateTimes use UTC. One could argue that the way those datetimes are presented to the user is up to the application, but well, I can't think if any place where we wouldn't want to use the local timezone. So IMHO the patch is OK.
Ah, but it doesn't cache the result of the conversion, so it might be slow. How about this patch instead?
Comment 6 David Faure 2008-04-21 19:20:14 UTC
Created attachment 24475 [details]
kfileitem.cpp patch with cache - untested, except for compilation
Comment 7 Peter Penz 2008-04-21 21:26:17 UTC
Thanks David for the update, I'll test your patch and will commit it afterwards!
Comment 8 Peter Penz 2008-04-23 19:24:36 UTC
SVN commit 800210 by ppenz:

respect local time zone (patch provided by David Faure)

CCMAIL: faure@kde.org
BUG: 160979

 M  +12 -5     kfileitem.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=800210
Comment 9 Peter Penz 2008-04-23 20:14:40 UTC
*** Bug 157534 has been marked as a duplicate of this bug. ***
Comment 10 Jakub Stachowski 2008-06-04 22:21:22 UTC
*** Bug 159309 has been marked as a duplicate of this bug. ***