Re: how to convert current time to format i need?

2014-05-01 Thread Alex Walker
https://github.com/mbossenbroek/simple-time (require '[simple-time.core :as t]) (t/format (t/now) dd:MM: HH:mm:ss) = 01:05:2014 21:16:27 On Tuesday, April 29, 2014 5:03:01 AM UTC-5, sindhu hosamane wrote: How to convert the current date and time to the format i need ? for example i

how to convert current time to format i need?

2014-04-29 Thread sindhu hosamane
How to convert the current date and time to the format i need ? for example i retrieve current time using (l/local-now) which outputs #DateTime 2014-04-29T11:16:02.420+02:00 i want the above output to be converted to format dd:MM: HH:mm:ss Should i define my own formatter like below

Re: how to convert current time to format i need?

2014-04-29 Thread Sunil S Nandihalli
Hi , I didn't verify if that particular formatter comes prepackaged ( I am assuming you are using clj-time since it is not mentioned..) Once you have created your custom formater all you have to do is unparse (clj-time.formatter/unparse date-time-object custom formatter ) . This is there in the

Re: how to convert current time to format i need?

2014-04-29 Thread sindhu hosamane
Ya i am using cji-time. Found a way . (def multi-parser (f/formatter (t/default-time-zone) dd:MM: HH:mm:ss -MM-dd HH:mm:ss)) (def currenttimestamp (f/unparse multi-parser (f/parse multi-parser (l/format-local-time ( l/local-now) :mysql))) ) (def custom-formatter