This project is read-only.
1

Resolved

Date format exception

description

2011-06-29 19:09:31.093 UTC
Our Redmine xml will send this date format, but ReadminTaskList not support parser this format.

Do I have any wrong setting?

Sorry for my poor English.

It's the exception.
System.FormatException: The string was not recognized as a valid DateTime. There is a unknown word starting at index 20.
於 System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
於 System.DateTime.Parse(String s, IFormatProvider provider)
於 Redmine.RedmineXmlParser.ParseDateTime(String s) 於 RedmineXmlParser.cs: line 163
於 Redmine.RedmineXmlParser.GetDateTime(XElement element, String descendantName) 於 RedmineXmlParser.cs: line 147
於 Redmine.RedmineXmlParser.ParseIssues(String xml) 於 RedmineXmlParser.cs: line 80
於 Redmine.Tests.RedmineXmlParserTests.ParseIssuesGhost() 於 RedmineXmlParserTests.cs: line 156

comments

lmn wrote Jul 22, 2014 at 9:02 AM

That's a strange date format, really. It should be like 2013-03-01T05:59:49Z.

GhostTW wrote Jul 22, 2014 at 10:04 AM

the another strange thing is that first issue shows normal date format, but after the first one date become wrong format.

I have no idea what's going on.

btw I'm from Taiwan.
<issues total_count="2" offset="0" limit="25" type="array">
<issue>
<id>1220</id>
<project id="31" name=""/>
<tracker id="3" name=""/>
<status id="1" name=""/>
<priority id="2" name=""/>
<author id="3" name=""/>
<assigned_to id="3" name=""/>
<subject></subject>
<description/>
<start_date>2014-07-22</start_date>
<due_date/>
<done_ratio>0</done_ratio>
<estimated_hours/>
<created_on>2014-07-22T03:05:18Z</created_on>
<updated_on>2014-07-22T03:05:18Z</updated_on>
<closed_on/>
</issue>
<issue>
<id>1219</id>
<project id="35" name=""/>
<tracker id="11" name=""/>
<status id="1" name=""/>
<priority id="2" name=""/>
<author id="16" name=""/>
<assigned_to id="16" name=""/>
<subject></subject>
<description></description>
<start_date>2014-07-22</start_date>
<due_date/>
<done_ratio>0</done_ratio>
<estimated_hours/>
<created_on>2014-07-22 01:13:43 UTC</created_on>
<updated_on>2014-07-22 01:13:43 UTC</updated_on>
<closed_on/>
</issue>
</issues>

lmn wrote Oct 11, 2014 at 8:24 PM

** Closed by lmn 10/11/2014 12:24PM

GhostTW wrote Oct 16, 2014 at 10:49 AM

I got another datetime format without .fff

xml likes below

<created_on>2014-07-22 01:13:43 UTC</created_on>
<updated_on>2014-07-22 01:13:43 UTC</updated_on>

lmn wrote Oct 16, 2014 at 10:05 PM

Fixed in changeset 8261ad93555e

Dandelion wrote Apr 17, 2015 at 11:10 AM

Hi,

I downloaded version 1.0.8 and I am still getting this error:
Username: -----; URL: http://***/***/
System.FormatException: String was not recognized as a valid DateTime.
   at System.DateTimeParse.ParseExactMultiple(String s, String[] formats, DateTimeFormatInfo dtfi, DateTimeStyles style)
   at System.DateTime.ParseExact(String s, String[] formats, IFormatProvider provider, DateTimeStyles style)
   at Redmine.RedmineXmlParser.ParseDateTime(String s)
   at Redmine.RedmineXmlParser.ParseIssues(String xml)
   at Redmine.RedmineService.GetIssues(String query)
   at RedmineTaskListPackage.IssueLoader.GetIssues(ConnectionSettings settings)
Anything else I should change?