how to add days to current date

17 views
Skip to first unread message

ted mosby

unread,
Nov 24, 2014, 11:11:00 PM11/24/14
to clj-...@googlegroups.com
Hello,

I want to add 7 days to current date, can anyone guide how this can be achieved as am a newbie to clojure ?

Thanks

Sean Corfield

unread,
Nov 26, 2014, 7:13:18 PM11/26/14
to clj-...@googlegroups.com
On Nov 24, 2014, at 8:11 PM, ted mosby <tedro...@gmail.com> wrote:
> I want to add 7 days to current date, can anyone guide how this can be achieved as am a newbie to clojure ?

Assuming you have clj-time’s dependency in your project.clj, you can do this:

user=> (require '[clj-time.core :as t])
nil
user=> (t/plus (t/now) (t/days 7))
#<DateTime 2014-12-04T00:12:07.312Z>

Sean Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)



Reply all
Reply to author
Forward
0 new messages