Date operation

Discussion of Common Lisp
Post Reply
Stiv
Posts: 11
Joined: Wed Sep 29, 2010 6:52 am

Date operation

Post by Stiv » Wed Dec 29, 2010 9:09 am

Hello all!

I have a problem, I've date in this form: @2010-12-29T17:05:43.000000+01:00

How can I add, for example, 10 days?

Thanks, bye

Warren Wilkinson
Posts: 117
Joined: Tue Aug 10, 2010 11:24 pm
Location: Calgary, Alberta
Contact:

Re: Date operation

Post by Warren Wilkinson » Wed Dec 29, 2010 12:47 pm

So I guess your using the local-time package then? Try:

Code: Select all

(timestamp+ date 10 :day)
Need an online wiki database? My Lisp startup http://www.formlis.com combines a wiki with forms and reports.

Stiv
Posts: 11
Joined: Wed Sep 29, 2010 6:52 am

Re: Date operation

Post by Stiv » Thu Dec 30, 2010 1:30 am

Thanks for reply.
Yes I use local-time package, this fn:

Code: Select all

(local-time::universal-to-timestamp (get-universal-time))
The fn (timestamp...) don't work :( .

Thanks very much,

bye

UPDATE:I solve so:

Code: Select all

(local-time::timestamp+ (local-time::universal-to-timestamp (get-universal-time)) 10 :day)

Thanks very much :)

Jasper
Posts: 209
Joined: Fri Oct 10, 2008 8:22 am
Location: Eindhoven, The Netherlands
Contact:

Re: Date operation

Post by Jasper » Tue Jan 18, 2011 2:20 pm


Warren Wilkinson
Posts: 117
Joined: Tue Aug 10, 2010 11:24 pm
Location: Calgary, Alberta
Contact:

Re: Date operation

Post by Warren Wilkinson » Tue Jan 18, 2011 6:21 pm

In this case he is using a library of time & date routines that store time in a specialized structure (basically just two unsigned 32's).

Read Eric Naggum's The Long, Painful History of Time for the 'why' of it.
Need an online wiki database? My Lisp startup http://www.formlis.com combines a wiki with forms and reports.

Post Reply