
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 6/24/10 03:52 , Luca Ciciriello wrote:
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
currentTimeStr :: IO Day -> String
You can't escape from IO, but you can lift a formatter into IO. Formatters are in Data.Time.Format; look at the documentation for your system's strftime() function to see how it works. - -- brandon s. allbery [linux,solaris,freebsd,perl] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkwjZuIACgkQIn7hlCsL25UwpgCfRuhCW5sB9G8Ud9Ci3JUZbVTt vAIAn3CFOoX9Q4etASv3ggC8KFxm94W6 =ZUFJ -----END PGP SIGNATURE-----