Google+ Followers

Sunday, 27 April 2014

Ruby subtract unix times and convert it into days and format DateTime

require 'date'
res=Time.now
days=2
res2=Time.now+(days*24*60*60)
DateTime.strptime(Time.now.utc.to_i.to_s,'%s').strftime("%d %m %y")
#find difference between 2 date times
((res2-res)/(24*60*60)).to_i

31 comments:

  1. http://bantalsilikon01.blogspot.com/2014/12/a.html
    http://jualsangkarpleci.blogspot.com/2014/12/a.html
    http://kopiluwakliar01.blogspot.com/2014/12/a.html
    http://vvty.in/uncategorized/marinir-seo/

    http://marinirseo.blogspot.com/2014/12/a.html
    http://marinir-seo.blogspot.com/2014/12/a.html
    http://bumbu-pecel-malang.blogspot.com/2014/12/a.html
    http://distro-seo.blogspot.com/2014/12/a.html
    http://restoran-seo.blogspot.com/2014/12/a.html
    http://bantalmalangmurah.blogspot.com/2014/12/a.html
    http://distrobantal.blogspot.com/2014/12/a.html
    http://kesethandukmalang.blogspot.com/2014/12/a.html

    http://marinir-seo-konsultan-12a.blogspot.com/2014/10/aaa.htmlhttp://asdf-14.blogspot.com/2014/10/hhh.htmlhttp://vvtiin.blogspot.com/2014/10/iii.htmlhttp://marinir-seo-8.blogspot.com/2014/10/jjj.htmlhttp://bantaljkt1.blogspot.com/2014/10/sss.htmlhttp://dfes12.blogspot.com/2014/10/rrr.htmlhttp://seo-guru01.blogspot.com/2014/10/qqq.htmlhttp://jksbindo.blogspot.com/2014/10/ppp.htmlhttp://jkt-49.blogspot.com/2014/10/ooo.htmlhttp://seokonsultan1.blogspot.com/2014/10/nnn.htmlhttp://guru-seo-malang.blogspot.com/2014/10/mmm.htmlhttp://seo-aaa.blogspot.com/2014/10/lll.htmlhttp://seo-konsultasi-mudah.blogspot.com/2014/10/kkk.htmlhttp://bantal-silikon15.blogspot.com/2014/10/ggg.htmlhttp://agen-seo16.blogspot.com/2014/10/fff.htmlhttp://agen-seo17.blogspot.com/2014/10/eee_30.htmlhttp://agen-seo18.blogspot.com/2014/10/ddd.htmlhttp://agen-seo19.blogspot.com/2014/10/ccc.htmlhttp://agen-seo20.blogspot.com/2014/10/bbb.htmlhttp://bumbu-pecel01.blogspot.com/2014/10/xxx.htmlhttp://bantalasdf.blogspot.com/2014/12/seo-sem-seo.htmlhttp://marinirseo17.blogspot.com/2014/10/ddd.htmlhttp://domainhosting15.blogspot.com/2014/10/fff.htmlhttp://marinirseo.blogspot.com/http://bantalsilikon01.blogspot.com/http://jualsangkarpleci.blogspot.com/http://marinir-seo.blogspot.com/http://kopiluwakliar01.blogspot.com/http://bumbu-pecel-malang.blogspot.com/http://distro-seo.blogspot.com/http://restoran-seo.blogspot.com/http://bantalmalangmurah.blogspot.com/http://distrobantal.blogspot.com/http://kesethandukmalang.blogspot.com/

    ReplyDelete
  2. Thanks for information Export Movers and Packers services in India provider low price save your time, comes with moving and packing services.
    Movers and Packers Mumbai
    Movers and Packers Hyderabad
    Movers and Packers Bangalore
    Movers and Packers Chennai
    Movers and Packers Pune

    ReplyDelete
  3. How did you can avail the give your dream a shape with the help of make your move Adword India's No 1 online business experts.
    http://www.adword.co.in/

    ReplyDelete
  4. All Packers and Movers India relocation services provided this company services are available pricrs for Top3th.
    Packers and Movers in Gurgaon
    Packers and Movers in Thane
    Packers and Movers in Navi Mumbai

    ReplyDelete
  5. If you are Packers and Movers gives you stress free relocation services provide transport and moving services
    Packers and Movers Delhi
    Packers and Movers Noida
    Packers and Movers Faridabad
    Packers and Movers Ghaziabad

    ReplyDelete
  6. Phenq is a powerful new slimming formula combining multiple weight loss benefits to help you get the slim, Find Phenq review at http://www.dietreviewmonster.com

    ReplyDelete
  7. PhenQ Reviews - Most Powerful Weight Loss Pills. PhenQ is the newest weight loss pill that has been proven by legitimate and smart science. http://phenq-reviews.com/

    ReplyDelete
  8. D-bal Max Reviews Safe and Legal Dianabol Steroids for Sale: Build Fast Muscle Mass with D-BAL Max. The oral steroid Dianabol was developed with athletes in mind.

    ReplyDelete
  9. Posts about history are cool! Nice one. diet pills

    ReplyDelete
  10. noocube Nootropics also called smart drugs, memory enhancers, neuro enhancers, cognitive enhancers, and intelligence enhancers. Find detailed Noocube review, effects & facts. http://www.noocube-nootropics.com/

    ReplyDelete
  11. Posts about history are cool! Nice one.Read these PhenQ customer reviews to find out does it work? Review of side ... It is not available at any local store close to you and not at any retailer. www.phenqreviewstore.com buy phenq

    ReplyDelete
  12. Interesting post. I Have Been wondering about this issue, so thanks for posting.
    Top Legal Anabolic Steroids
    Crazy Bulk Reviews
    Crazy Bulk Review

    ReplyDelete
  13. TestoGen boosts your testosterone in a safe, natural way to increase your muscle size and strength while reducing body fat

    ReplyDelete
  14. If you are looking for some reliable way to shed the excess amount of unwanted fat from your body then the best option is Forskolin Fuel http://www.wheretobuyforskolinfuel.com/
    Forskolin Fuel

    ReplyDelete
  15. Looking for proven, effective Dianabol for Sale without side effects? Discover premium Dbal-Max Pills currently helping guys build mass safely. http://www.dbalmax-reviews.com/

    ReplyDelete
  16. Breast Actives
    is a 3 step all natural solution for breast enlargement, combining breast pills, cream and a breast exercise and massage program.http://www.breastactivesbuy.com/

    ReplyDelete
  17. " cognitive enhancers
    fall into two or smart drugs. Learn how these substances help or harm the brain and how to make healthy choices. http://www.noocube-review.com"

    ReplyDelete
  18. " Nootropics or smart drugs, are being used around the world by students, entrepreneurs, small business owners, athletes, poker players and housewives. http://www.noocube-review.com/"

    ReplyDelete
  19. Male Extra pills are famous on the market. But you have to know some side effects and results. My prof review will help you. http://www.maleextrareviewguide.com

    ReplyDelete
  20. having more sex can make you live longer Male Extra pills are famous on the market. But you have to know some side effects and results. My prof review will help you.

    ReplyDelete
  21. Anabolic Steroids Anabolic steroids are synthetic variations of the male sex hormone testosterone Anabolic steroids are synthetic variations of the male sex hormone testosterone They promote the growth of skeletal muscle (anabolic effects) and the development of male sexual characteristics (androgenic effects) in both males and females. http://www.legalmusclesteroids.com

    ReplyDelete