[Mono-dev] DateTime.ParseExact bug ?

Nicklas Overgaard nicklas at isharp.dk
Sun Sep 18 18:04:20 EDT 2011


Yes, i'm very sure - it's copy-paste from the solrnet source code: 
https://github.com/mausch/SolrNet/blob/master/SolrNet/Impl/FieldParsers/DateTimeFieldParser.cs

And the code-snippet I attached below does indeed work on windows in .net :)

/Nicklas

On 2011-09-18 23:00, Stefano Canepa wrote:
>
> Nicklas Overgaard  at "Sun, 18 Sep 2011 18:34:08 +0200" wrote:
>   NO>  Hi,
>
>   NO>  I'm currently working with Solr and SolrNet for a project. However, i'm
>   NO>  encountering errors when SolrNet is parsing date times...
>
>   NO>  I have located the date-time parsing code in SolrNet, and made a sample
>   NO>  test application shown below:
>
>   NO>  <code start>
>   NO>  using System;
>   NO>  using System.Linq;
>   NO>  using System.Globalization;
>
>   NO>  namespace datetimeparsing
>   NO>  {
>   NO>       class MainClass
>   NO>       {
>   NO>           public static void Main (string[] args)
>   NO>           {
>   NO>               string s = "1984-09-17T09:00:00Z";
>   NO>               DateTime dt=  DateTime.ParseExact(s,
>   NO>  "yyyy-MM-dd'T'HH:mm:ss.FFF'Z'", CultureInfo.InvariantCulture);
>   NO>           }
>   NO>       }
>   NO>  }
>   NO>  </code end>
>
> Are you sure about the format string? I think that you need to write only
> FF'Z instead of FFF'Z. Did you take a look at mono source code?
>
> Bye
> Stefano
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20110919/5a0e0a42/attachment.html 


More information about the Mono-devel-list mailing list