<span id="result_box" class="short_text" lang="fr"><span title="Click for alternate translations" class="hps">Magnifique</span></span>, ca marche! Grand merci, Vincent! <br><br><div class="gmail_quote">On Wed, Jun 15, 2011 at 1:16 AM, Vincent Gerard <span dir="ltr"><<a href="mailto:vincent@xenbox.fr">vincent@xenbox.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello Dmitri,<br>
<br>
It seems that your format pattern does not match exactly the format of<br>
the input, thus the parser returns Nothing.<br>
<br>
Try the following format string which seems to work with your date:<br>
<br>
parseTime defaultTimeLocale "%m/%d/%Y %l:%M:%S %p" ds :: Maybe<br>
UTCTime returns : Just 2009-10-11 19:04:28 UTC<br>
<br>
The parsings errors in your format could come from<br>
. %D expects a 2 char year<br>
. %H expects a 0 padded hour (like 07, not 7)<br>
<br>
Regards,<br>
<br>
Vincent Gerard<br>
<br>
On Wed, 15 Jun 2011 00:33:56 +0400<br>
<div class="im">"Dmitri O.Kondratiev" <<a href="mailto:dokondr@gmail.com">dokondr@gmail.com</a>> wrote:<br>
<br>
</div><div><div></div><div class="h5">> I am trying to convert data string to time:<br>
><br>
> import Data.Time<br>
> import Data.Time.Format<br>
> import Locale<br>
><br>
> ds = "10/11/2009 7:04:28 PM"<br>
> t = parseTime defaultTimeLocale "%D %H:%M:%S %p" ds :: Maybe UTCTime<br>
><br>
> and get "Nothing".<br>
> What is wrong?<br>
><br>
> Thanks !<br>
> Dmitri.<br>
<br>
</div></div></blockquote></div><br><br clear="all"><br><br><br>