Defect #2149

Git Adapter date parsing ignores timezone

Added by Kevin Chan about 9 years ago. Updated about 9 years ago.

Status:ClosedStart date:2008-11-08
Priority:HighDue date:
Assignee:-% Done:

0%

Category:SCM
Target version:0.8
Resolution:Fixed Affected version:

Description

Git adapter uses Time.parse() on the date string, in the format Sat Nov 8 02:20:44 2008 -0800

TIme.parse() is unable to parse the timezone in the above date correctly:

in irb:

>> Time.parse("Sat Nov 8 02:20:44 2008 -0800")
=> Sat Nov 08 02:20:44 -0600 2008

The correct output should be the following (notice the placement of the year segment)

>> Time.parse("Sat Nov 8 2008 02:20:44 -0800")
=> Sat Nov 08 04:20:44 -0600 2008

This is causing a major issue with the repository to have incorrect times.

Associated revisions

Revision 1995
Added by Jean-Philippe Lang about 9 years ago

Tells git to output dates in ISO format.
Fixes: Git Adapter date parsing ignores timezone (#2149).

History

#1 Updated by Jean-Philippe Lang about 9 years ago

  • Status changed from New to Resolved
  • Resolution set to Fixed

I added --date=iso option to git commands in r1995.
That should fix the date parsing problem. Can you confirm?

#2 Updated by Kevin Chan about 9 years ago

You changed path to git in your commit.

Might want to change that back.

#3 Updated by Jean-Philippe Lang about 9 years ago

Sorry, fixed. Can I close this ticket ?

#4 Updated by Kevin Chan about 9 years ago

Jean-Philippe Lang wrote:

Sorry, fixed. Can I close this ticket ?

Yea, works great.

#5 Updated by Jean-Philippe Lang about 9 years ago

  • Status changed from Resolved to Closed
  • Target version set to 0.8

Also available in: Atom PDF