Timestamps in microsecs, wrong dates in github
Hi, Context : Trac 1.0.1, trac2github 76e8befb3cf261e539b6f9563f0ddb390e4d1f0a I use a PostgreSQL Trac database and I had to divide all times by 1000000 to get right dates for milestones, tickets and comments (date() php function takes epoch in secs only). Once done, milestones, tickets and comments dates are all right in GitHub.
Example: $resp = github_add_milestone(array( 'title' => $row['name'], 'state' => $row['completed'] == 0 ? 'open' : 'closed', 'description' => empty($row['description']) ? 'None' : $row['description'], 'due_on' => date('Y-m-d\TH:i:s\Z', (int) ($row['completed']/1000000))
What do you think ?
What datatype does Trac use to store those dates in Postgres?
tracdb=# \d+ ticket
Table "public.ticket"
Column | Type | Modifiers | Storage | Description
-------------+---------+-----------------------------------------------------+----------+-------------
id | integer | not null default nextval('ticket_id_seq'::regclass) | plain |
type | text | | extended |
time | bigint | | plain |
changetime | bigint | | plain |
component | text | | extended |
severity | text | | extended |
priority | text | | extended |
owner | text | | extended |
reporter | text | | extended |
cc | text | | extended |
version | text | | extended |
milestone | text | | extended |
status | text | | extended |
resolution | text | | extended |
summary | text | | extended |
description | text | | extended |
keywords | text | | extended |
Oh, it's bigint. Then it makes sense converting into seconds if database is Postgres. Would you create another PR for this please?