Hacker News new | ask | show | jobs
by carl_dr 1300 days ago
ruby -rdate -e'b=DateTime.new 0;loop{b+=1/86400r;c=b.strftime"%y%m%d%H%M%S";puts b.strftime"%y-%m-%d %H:%M:%S"if c==c.reverse}'

127. Script never terminates, but it does display all possibilities, so I think it still passes!

Edit: 126. ruby -rdate -e'b=DateTime.new 0;loop{b+=1/86400r;puts b.strftime"%y-%m-%d %H:%M:%S"if(c=b.strftime"%y%m%d%H%M%S")==c.reverse}'

I think I'm done for the moment, will revisit tomorrow if you can find any further savings!