-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 23.10.2012 22:31, Will0417 wrote:
> I am having a hell of a time generating a report with dates of creation
> for my tickets.
>  
> here is my sqlite query
>  
> .header on
> .mode csv
> .output opentickets.csv
> SELECT DISTINCT
>    id AS ticket, summary, status, priority, t.type AS type,
>    owner, time as created
>  
>   FROM ticket t, ticket_custom q
>   LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
>   WHERE t.id = q.ticket AND status <> 'closed'
>  ORDER BY  priority, time;
>  
> But the value I get for the time of creation is garbage:
> I get 1341324096360000
> when I should get
> 2012-07-03
>  
> I have tried unix epoch time conversion but then I get
> query:
> .header on
> .mode csv
> .output opentickets.csv
> SELECT DISTINCT
>    id AS ticket, summary, status, priority, t.type AS type,
>    owner, datetime(time, 'unixepoch') as created
>  
>   FROM ticket t, ticket_custom q
>   LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
>   WHERE t.id = q.ticket AND status <> 'closed'
>  ORDER BY  priority, time;
>  
> I get: 
> -1413-03-01 13:07:12

Relevant parts are in your embedded Trac wiki documentation,
 see wiki/TracReports
  Advanced Reports: Custom Formatting
   Automatically formatted columns

created, modified, date, time — Format cell as a date and/or time

(Automatic conversion is a ReportModule feature. If you query the Trac
db directly, you'll still have to do it on your own. Look at
trac.util.datefmt.to_datetime and .format_date for that.)

But this is what you already have, and your query works for me with
correct formatted date output, so the report query isn't the issue here.
Clearly you get the raw time stamp instead.

Do you see any issues reported to your log? Check with DEBUG log level
enabled, if you didn't before

But after all the conversion has no external dependency, it's a standard
internal part of Trac core. Even can't think of a possible way to
disrupt it by configuration alone, so your Trac install may be broken in
some way.

OTOH you may still want to post relevant trac.ini parts here anyway so
that we can have a look and be sure.

Steffen Hoffmann
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlCHXeMACgkQ31DJeiZFuHeOCACfXKztIeEtppdWpJzmfRg4NrVA
aFsAn0EN8YrxZRZBmMhxf3OwYmgMVoVJ
=r6Zu
-----END PGP SIGNATURE-----

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

Reply via email to