
24 Jun
2010
24 Jun
'10
7:59 a.m.
On 24 June 2010 10:52, Luca Ciciriello
Just a question. How can I obtain a String from
currentTime :: IO Day currentTime = utctDay `fmap` getCurrentTime
Here currentTime returns to me 2010-06-24, but I want "2010-06-24". In another worlds I need a function
I bet Day has a Show instance (that's why you get 2010-06-24 in ghci I suppose) Just use that.
currentTimeStr :: IO Day -> String
Getting out of IO? I would think again. Following might be what you really want: currentTimeStr :: IO Day -> IO String
Any Idea?
Luca.
Best, Ozgur