Edgewall Software

Opened 16 years ago

Closed 16 years ago

#2257 closed enhancement (worksforme)

Provide magic $NOW value to reports

Reported by: fumanchu@… Owned by: daniel
Priority: normal Milestone:
Component: report system Version: devel
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:


I've added the $NOW magic variable to my reports:

# inside trac/ticket/report.py

        if not report_args.has_key('USER'):
            report_args['USER'] = req.authname
+         if not report_args.has_key('NOW'):
+             report_args['NOW'] = str(int(time.time()))

It's nice when making reports that show how long tickets have been open, using ($NOW - ticket.time) / 3600 to show hours.

Attachments (0)

Change History (2)

comment:1 by anonymous, 16 years ago

Type: defectenhancement

Sorry, should have been an enhancement.

comment:2 by Matthew Good, 16 years ago

Resolution: worksforme
Status: newclosed

Date computations compared to the current time can already be done with the database's built-in date and time methods. For SQLite see http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions

So for example to get the number of days a ticket has been open:

select julianday('now') - julianday(time, 'unixepoch') from ticket

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain daniel.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from daniel to the specified user.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.