Bug 160979

Summary: Dolphin shows time information in UTC and not in locale timezone
Product: [Applications] dolphin Reporter: Martin Flöser <mgraesslin>
Component: generalAssignee: Peter Penz <peter.penz19>
Status: RESOLVED FIXED    
Severity: normal CC: amantia, faure, jesusvpct
Priority: NOR    
Version: 16.12.2   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Screenshot showing the difference in change time in dolphin and terminal
Make KFileItem return time in local zone
kfileitem.cpp patch with cache - untested, except for compilation

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. ***