Skip to content

Timestamps in microsecs, wrong dates in github #19

@bflorat

Description

@bflorat

Hi,
Context : Trac 1.0.1, trac2github 76e8bef
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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions