Fossil

View Ticket
Login

View Ticket

Ticket Hash: 5c1490e26b8b2f8689896df9e1632a249c95dbb7
Title: The ticket comments appear with the time always on UTC
Status: Closed Type: Code_Defect
Severity: Important Priority:
Subsystem: Resolution: Works_As_Designed
Last Modified: 2024-01-29 09:23:36
Version Found In: 12a79e5b93
Description:
The Timeline page, and the Ticket History page appear with proper localtime if the server is configured to show local time. But the ticket page, where there are introductions to comments like "xxxx added on 2010-10-20 15:44:03:", this always appears in UTC time.

anonymous added on 2010-10-20 21:02:25:
I see it's written in the artifact in plain text, so I propose adding "UTC" in the time string.

As in "xxx added on 2010-03-04 15:32 UTC: ".


anonymous claiming to be Alex added on 2010-12-30 11:53:21:
I attach a patch which adds a TH1 function "datelocal" which allows the ticket comment timestamps to be in the local time.


anonymous claiming to be Alex added on 2010-12-30 13:27:09:
I made a better patch, please ignore the one attached as "aa".
It adds a TH1 function datetolocal which converts a date-and-time parameter from UTC into local time zone. Usage (on Edit ticket page):
set ctxt "$ctxt added on [datetolocal [date]]:</i><br />\n$cmappnd"
or (on View ticket page)
<th1>html [datetolocal $tkt_datetime]</th1>


anonymous claiming to be Alex added on 2010-12-31 07:12:49 UTC:
Maybe it should be a separate ticket, but the fix that DRH made in http://fossil-scm.org/index.html/fdiff?v1=ef3bb3e834513608&v2=602acd7e19a26fb0 does not allow the View ticket page to show last modified time in local time zone. That's why in my patch I made date a parameter passed to 'datetolocal' function instead of always returning 'now'. Perhaps make date-to-be-converted an optional parameter to 'date' function too?

User Comments:
added on 2024-01-29 09:23:36:
Closing as part of periodic cleanup.

Attachments: