From: Michael Kohout
Subject: Newbie:  How should Lispers deal with date/times?  Any packages?
Date: 
Message-ID: <1194647100.737561.35440@o80g2000hse.googlegroups.com>
Hi-

I've been playing around with Clozure Lisp for a little while, and I'm
looking to use it to (at least) prototype a system with it (and cl-
weblocks).

This application/prototype performs operations on dates and times.
I've done some reading and discovered decode-universal-time and get-
usersal-time and understand their encoding, but coming from a Java
background, these functions seem kind of basic.

So I was hoping one of you fine folks might know of a more robust
library.  Off the top of my head it would need to be able to take a
datetime and convert it to a string(at this stage, since this is a
prototype i18n isn't necessary), verify that a privided datetime is
valid(so that it will error should someone try to create a date object
for November 31, for example) and do date math.

Any suggestions?

thanks
Mike

From: Antony Sequeira
Subject: Re: Newbie:  How should Lispers deal with date/times?  Any packages?
Date: 
Message-ID: <ueWdnW_0ms1LsKvanZ2dnUVZ_r3inZ2d@comcast.com>
Michael Kohout wrote:
> I've done some reading and discovered decode-universal-time and get-
> usersal-time and understand their encoding, but coming from a Java
> background, these functions seem kind of basic.
> 
> So I was hoping one of you fine folks might know of a more robust
> library.  Off the top of my head it would need to be able to take a
> datetime and convert it to a string(at this stage, since this is a
> prototype i18n isn't necessary), verify that a privided datetime is
> valid(so that it will error should someone try to create a date object
> for November 31, for example) and do date math.
There is
http://common-lisp.net/project/local-time/
I am still trying to figure it out. I asked a question about it here, 
but no one replied so far.
Subscribed to its mailing list , but no response there either , but I 
think thats cause they are having technical problems with the list 
servers (hearsay).
But I am hopeful since so far i haven't run into any real road block 
other than not having enough time :)
Whatever functions I have tried (by looking at its test code) so far 
made sense.

I don't know if it would work in mac env though cause it somehow reads 
timezone info from the tzdata files (I think) in Linux

-Antony
From: Zach Beane
Subject: Re: Newbie:  How should Lispers deal with date/times?  Any packages?
Date: 
Message-ID: <m3ve8akfrd.fsf@unnamed.xach.com>
Michael Kohout <········@gmail.com> writes:

> Hi-
>
> I've been playing around with Clozure Lisp for a little while, and I'm
> looking to use it to (at least) prototype a system with it (and cl-
> weblocks).
>
> This application/prototype performs operations on dates and times.
> I've done some reading and discovered decode-universal-time and get-
> usersal-time and understand their encoding, but coming from a Java
> background, these functions seem kind of basic.
>
> So I was hoping one of you fine folks might know of a more robust
> library.  Off the top of my head it would need to be able to take a
> datetime and convert it to a string(at this stage, since this is a
> prototype i18n isn't necessary), verify that a privided datetime is
> valid(so that it will error should someone try to create a date object
> for November 31, for example) and do date math.
>
> Any suggestions?

I think this is something so easy to roll on demand, nobody has of
late written a reusable, public library for such tasks. It'd be pretty
nice to have a defacto answer for this question, but I don't know of
one.

I have my own date-part binding function, and a date stringifying
function (it does stuff like (format-time nil "~{Month} ~{Year}
~{Day}")), but they're not something I'm ready to release as reusable
software.

Zach
From: Rainer Joswig
Subject: Re: Newbie:  How should Lispers deal with date/times?  Any packages?
Date: 
Message-ID: <joswig-547DC7.09224210112007@news-europe.giganews.com>
In article <·······················@o80g2000hse.googlegroups.com>,
 Michael Kohout <········@gmail.com> wrote:

> Hi-
> 
> I've been playing around with Clozure Lisp for a little while, and I'm
> looking to use it to (at least) prototype a system with it (and cl-
> weblocks).
> 
> This application/prototype performs operations on dates and times.
> I've done some reading and discovered decode-universal-time and get-
> usersal-time and understand their encoding, but coming from a Java
> background, these functions seem kind of basic.
> 
> So I was hoping one of you fine folks might know of a more robust
> library.  Off the top of my head it would need to be able to take a
> datetime and convert it to a string(at this stage, since this is a
> prototype i18n isn't necessary), verify that a privided datetime is
> valid(so that it will error should someone try to create a date object
> for November 31, for example) and do date math.
> 
> Any suggestions?
> 
> thanks
> Mike


If you look around on the net, there is lots of code for
dealing with time and date in Lisp. There is no
'standard' though. The usual Common Lisp problem.

Haven't used this one: http://common-lisp.net/project/local-time/

If you want to deal with strange calendars, see this:
http://emr.cs.iit.edu/~reingold/calendar.l
From: John Thingstad
Subject: Re: Newbie:  How should Lispers deal with date/times?  Any packages?
Date: 
Message-ID: <op.t1kncgm2ut4oq5@pandora.alfanett.no>
P� Fri, 09 Nov 2007 23:25:00 +0100, skrev Michael Kohout  
<········@gmail.com>:

> Hi-
>
> I've been playing around with Clozure Lisp for a little while, and I'm
> looking to use it to (at least) prototype a system with it (and cl-
> weblocks).
>
> This application/prototype performs operations on dates and times.
> I've done some reading and discovered decode-universal-time and get-
> usersal-time and understand their encoding, but coming from a Java
> background, these functions seem kind of basic.
>
> So I was hoping one of you fine folks might know of a more robust
> library.  Off the top of my head it would need to be able to take a
> datetime and convert it to a string(at this stage, since this is a
> prototype i18n isn't necessary), verify that a privided datetime is
> valid(so that it will error should someone try to create a date object
> for November 31, for example) and do date math.
>
> Any suggestions?
>
> thanks
> Mike
>

I wrote some patchy code on that subject.. It is incomplete but may still  
serve your purpose.

http://cl-php-date.sourceforge.net/

--------------
John Thingstad
From: Frank Goenninger DG1SBG
Subject: Re: Newbie:  How should Lispers deal with date/times?  Any packages?
Date: 
Message-ID: <lzbqa28e9a.fsf@pcsde001.de.goenninger.net>
Michael Kohout <········@gmail.com> writes:

> Hi-
>
> I've been playing around with Clozure Lisp for a little while, and I'm
> looking to use it to (at least) prototype a system with it (and cl-
> weblocks).
>
> This application/prototype performs operations on dates and times.
> I've done some reading and discovered decode-universal-time and get-
> usersal-time and understand their encoding, but coming from a Java
> background, these functions seem kind of basic.
>
> So I was hoping one of you fine folks might know of a more robust
> library.  Off the top of my head it would need to be able to take a
> datetime and convert it to a string(at this stage, since this is a
> prototype i18n isn't necessary), verify that a privided datetime is
> valid(so that it will error should someone try to create a date object
> for November 31, for example) and do date math.
>
> Any suggestions?

Interesting subject. No actual code but IMO informative related
reading: 

http://naggum.no/lugm-time.html

Frank

-- 

  Frank Goenninger

  frgo(at)mac(dot)com

  "Don't ask me! I haven't been reading comp.lang.lisp long enough to 
  really know ..."
From: Luigi Panzeri
Subject: Re: Newbie:  How should Lispers deal with date/times?  Any packages?
Date: 
Message-ID: <m2wssqmcyx.fsf@matley.muppetslab.org>
Try:
* http://www.common-lisp.org/project/cl-date-calc/

and the asdf-installabe (also packaged with debian/ubuntu) package:
* http://www.cliki.net/net-telent-date