I have the same issue ... does anyone else out there have an example of a working query with the correct format ? Much appreciated !
Best Regards, Joe ________________________________________________________________________________________ Joseph H. Dayney | Software Engineer | RR Donnelley 630W 1000N | Logan, UT 84321 | (: 435-755-4278 | 801-453-5015 |È: 435-770-7244 | Ê: 435-755-4210 | *: [EMAIL PROTECTED] This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. "Noah Kantrowitz" <[EMAIL PROTECTED]> Sent by: [email protected] 05/28/2008 12:51 PM Please respond to [email protected] To <[email protected]> cc Subject [Trac] Re: Formatting dates in reports "created" is a magic column name in reports, that triggers automated formatting. This formatting requires the row values to be epoch time stamps (seconds since Jan 1, 1970 00:00:00). You will need use a different column name. --Noah -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of emx Sent: Wednesday, May 28, 2008 10:43 AM To: [email protected] Subject: [Trac] Formatting dates in reports I have been trying to customize the SQL of some reports so they display the date in a different format. I have read around and tried to apply the examples I could find. However none of my attempts worked, and all resulted in the same error. I use trac 0.10.4 on Ubuntu 8 For example consider the query: select time as CREATED from ticket I would like to change it so it displays the time as well, so I tried: select strftime('%Y%m%d-%H%M', datetime(time, 'unixepoch')) as CREATED from ticket select strftime('%Y%m%d-%H%M', time, 'unixepoch') as CREATED from ticket select strftime('%Y%m%d-%H%M', time) as CREATED from ticket All of them result in: "TRAC detected an internal error", with the following Python traceback: Traceback (most recent call last): File "/var/lib/python-support/python2.5/trac/web/main.py", line 406, in dispatch_request dispatcher.dispatch(req) File "/var/lib/python-support/python2.5/trac/web/main.py", line 237, in dispatch resp = chosen_handler.process_request(req) File "/var/lib/python-support/python2.5/trac/ticket/report.py", line 88, in process_request resp = self._render_view(req, db, id) File "/var/lib/python-support/python2.5/trac/ticket/report.py", line 346, in _render_view value['date'] = format_date(cell) File "/var/lib/python-support/python2.5/trac/util/datefmt.py", line 68, in format_date return format_datetime(t, format, gmt) File "/var/lib/python-support/python2.5/trac/util/datefmt.py", line 58, in format_datetime t = time.localtime(float(t)) ValueError: invalid literal for float(): 20080528-22:41 -- View this message in context: http://www.nabble.com/Formatting-dates-in-reports-tp17518209p17518209.html Sent from the Trac Users mailing list archive at Nabble.com. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Trac Users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/trac-users?hl=en -~----------~----~----~----~------~----~------~--~---
