Then you might want to use something like:<br><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">currentTimeStr :: IO String</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">currentTimeStr = do ct &lt;- currentTime</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">                    return (&quot;File creation date: &quot; ++ show ct ++ &quot; by MyCompany&quot;)</span><br>
<br>Or more concisely,<br><br><span style="font-family: courier new,monospace;">currentTimeStr :: IO String</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">currentTimeStr = liftM (\ ct -&gt; &quot;File creation date: &quot; ++ show ct ++ &quot; by MyCompany&quot; ) currentTime</span><br style="font-family: courier new,monospace;">
<br>My point is, the type of currentTimeStr is IO String, not just String. Because you are working on an IO value.<br><br>Best,<br><br>PS: If you are not confident with the piece of code I&#39;ve suggested, please have a look at the io/monads/do-notation sections of the Real World Haskell.<br>
<br><br><div class="gmail_quote">On 24 June 2010 11:17, Luca Ciciriello <span dir="ltr">&lt;<a href="mailto:luca_ciciriello@hotmail.com">luca_ciciriello@hotmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div style="word-wrap: break-word;">Starting from the beginning, my original problem is to create the string:<div><br></div><div>&quot;File creation date:  &quot; ++ currentSystemDate ++ &quot; by MyCompany&quot;</div><div>
<br></div><div>to obtain the string</div><div><br></div><div>&quot;File creation date: 2010-06-24 by MyCompany&quot;</div><div><br></div><div>Probably this is really trivial, but I&#39;m a real beginner in Haskell and this seems to me a big problem.</div>
<div><br></div><font color="#888888"><div>Luca.</div></font><div><div></div><div class="h5"><div><br><div><div>On Jun 24, 2010, at 9:59 AM, Ozgur Akgun wrote:</div><br><blockquote type="cite">On 24 June 2010 10:52, Luca Ciciriello <span dir="ltr">&lt;<a href="mailto:luca_ciciriello@hotmail.com" target="_blank">luca_ciciriello@hotmail.com</a>&gt;</span> wrote:<br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Just a question.<br>
How can I obtain a String from<br>
<br>
currentTime :: IO Day<br>
currentTime =  utctDay `fmap` getCurrentTime<br>
<br>
Here currentTime returns to me 2010-06-24, but I want &quot;2010-06-24&quot;.<br>
In another worlds I need a function<br>
<br></blockquote><div><br>I bet Day has a Show instance (that&#39;s why you get 2010-06-24 in ghci I suppose)<br>Just use that.<br><br> <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


currentTimeStr :: IO Day -&gt; String<br>
<br></blockquote><div><br>Getting out of IO? I would think again. Following might be what you really want:<br><br>currentTimeStr :: IO Day -&gt; IO String<br><br> <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


Any Idea?<br>
<font color="#888888"><br>
Luca.<br>
</font><div><div></div><div></div></div></blockquote><div> <br>Best,<br>Ozgur <br></div></div>
</blockquote></div><br></div></div></div></div></blockquote></div><br><br clear="all"><br>-- <br>Ozgur Akgun<br>