Live data from Hacker News

22-11-22 22:11:22

news.ycombinator.com

21–30 of 40 posts

Re: 22-11-22 22:11:22

#22
post #19

Earlier 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.

~~`b=DateTime.new(0,1,1)+_1/86400r;`-> `b=_1/86400r+DateTime.new 0`~~ oops

Re: 22-11-22 22:11:22

#23
post #19

Earlier 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.

[deleted]

Re: 22-11-22 22:11:22

#24
post #19

Earlier 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

That doesn't work unfortunately, you need the brackets - DateTime has to be on the left.

Re: 22-11-22 22:11:22

#25
post #24

Earlier 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.

ah, my bad.

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

#26
post #19

Earlier 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

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!

Re: 22-11-22 22:11:22

#27

Just realized that on 22-11–22, 22:11:22 I had exactly 212 HN karma points - surely the Universe is trying to say something…

Now the question is, would you like to be downvoted to maintain stasis, or try to get to 2112 karma before tomorrow? :)

Re: 22-11-22 22:11:22

#30

Unix 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.

1666666666 was special, though. A beast of a number, no, three beasts of a number.
Post reply on HN