Page 1 of 1

Date operation

Posted: Wed Dec 29, 2010 9:09 am
by Stiv
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

Re: Date operation

Posted: Wed Dec 29, 2010 12:47 pm
by Warren Wilkinson
So I guess your using the local-time package then? Try:

Code: Select all

(timestamp+ date 10 :day)

Re: Date operation

Posted: Thu Dec 30, 2010 1:30 am
by Stiv
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 :)

Re: Date operation

Posted: Tue Jan 18, 2011 2:20 pm
by Jasper

Re: Date operation

Posted: Tue Jan 18, 2011 6:21 pm
by Warren Wilkinson
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.