22-11-22 22:11:22
21–30 of 40 posts
Re: 22-11-22 22:11:22
#22Earlier quoted context omitted.
`ruby -e 'require"date";0.upto(4e9){b=DateTime.new(0,1,1)+_1/86400r;c=b.strftime"%y%m%d%H%M%S";p b.strftime"%y-%m-%d %H:%M:%S"if c==c.reverse}'` 142? Sorry if I broke anything, on phone.
You need to use puts to avoid quotes being added around the output - so I'll give you 145! I'm on my phone too, I'm impressed I even got something working, you've done brilliantly. Edit: DateTime.new(0) seems to work. 141.
Re: 22-11-22 22:11:22
#23Earlier quoted context omitted.
`ruby -e 'require"date";0.upto(4e9){b=DateTime.new(0,1,1)+_1/86400r;c=b.strftime"%y%m%d%H%M%S";p b.strftime"%y-%m-%d %H:%M:%S"if c==c.reverse}'` 142? Sorry if I broke anything, on phone.
You need to use puts to avoid quotes being added around the output - so I'll give you 145! I'm on my phone too, I'm impressed I even got something working, you've done brilliantly. Edit: DateTime.new(0) seems to work. 141.
Re: 22-11-22 22:11:22
#24Earlier quoted context omitted.
You need to use puts to avoid quotes being added around the output - so I'll give you 145! I'm on my phone too, I'm impressed I even got something working, you've done brilliantly. Edit: DateTime.new(0) seems to work. 141.
~~`b=DateTime.new(0,1,1)+_1/86400r;`-> `b=_1/86400r+DateTime.new 0`~~ oops
Re: 22-11-22 22:11:22
#25Earlier quoted context omitted.
~~`b=DateTime.new(0,1,1)+_1/86400r;`-> `b=_1/86400r+DateTime.new 0`~~ oops
That doesn't work unfortunately, you need the brackets - DateTime has to be on the left.
This should work for 134:
`ruby -r date -e '0.upto(4e9){b=DateTime.new(0)+_1/86400r;puts b.strftime"%y-%m-%d %H:%M:%S"if(c=b.strftime"%y%m%d%H%M%S")==c.reverse}'`
Re: 22-11-22 22:11:22
#26Earlier quoted context omitted.
You need to use puts to avoid quotes being added around the output - so I'll give you 145! I'm on my phone too, I'm impressed I even got something working, you've done brilliantly. Edit: DateTime.new(0) seems to work. 141.
~~`b=DateTime.new(0,1,1)+_1/86400r;`-> `b=_1/86400r+DateTime.new 0`~~ oops
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!
Re: 22-11-22 22:11:22
#27Just realized that on 22-11–22, 22:11:22 I had exactly 212 HN karma points - surely the Universe is trying to say something…
Re: 22-11-22 22:11:22
#28I still regret missing Michael Scott's 05-05-05 party. It only happens once every billion years.
Re: 22-11-22 22:11:22
#29Re: 22-11-22 22:11:22
#30Unix time 1666666666 happened last month, on October 25th 02:57:46 UTC. A closer "round" number will be 1670000000, happening next month on December 2nd 16:53:20 UTC. But for 1700000000 we'll have to wait until next year, November 14th 22:13:20 2023 UTC.