[Haskell-beginners] get date (SOLVED)

Luca Ciciriello luca_ciciriello at hotmail.com
Thu Jun 24 02:52:04 EDT 2010


Thanks Felipe.
Yes I use getCurrentTime. But I found I a stupid error in my code.
Now all works fine.
Thanks anyway for your answer.

Luca.


On Jun 23, 2010, at 8:13 PM, Felipe Lessa wrote:

> On Wed, Jun 23, 2010 at 08:03:16PM +0200, Luca Ciciriello wrote:
>> How can I get the current system date-time in Haskell?
>> 
>> I've used the library Time, but on MacOS X 10.6.4 the year is always 0.
>> 
>> Luca.
> 
> Do you mean, you used getCurrentTime from the time package[1]?
> What does the following line do?
> 
>  (toGregorian . utctDay) `fmap` getCurrentTime
> 
> On my system,
> 
>  GHCi, version 6.10.4: http://www.haskell.org/ghc/  :? for help
>  Loading package ghc-prim ... linking ... done.
>  Loading package integer ... linking ... done.
>  Loading package base ... linking ... done.
>  Prelude> :m Data.Time
>  Prelude Data.Time> (toGregorian . utctDay) `fmap` getCurrentTime
>  Loading package old-locale-1.0.0.1 ... linking ... done.
>  Loading package time-1.1.4 ... linking ... done.
>  (2010,6,23)
> 
> http://hackage.haskell.org/packages/archive/time/1.2.0.3/doc/html/Data-Time-Clock.html#v%3AgetCurrentTime
> 
> HTH,
> 
> --
> Felipe.
> 



More information about the Beginners mailing list