Settings

Theme

22-11-22 22:11:22

95 points by lun4r 3 years ago · 39 comments · 1 min read

Reader

A palindrome date, time and datetime (:

DrNosferatu 3 years ago

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…

timeaway 3 years ago

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.

  • ASalazarMX 3 years ago

    1666666666 was special, though. A beast of a number, no, three beasts of a number.

    • a9h74j 3 years ago

      Am I correct that the 32nd prime is 1,453,168,141, and the 33rd prime is 2,300,942,549?

      I've noticed good times like that getting fewer and farther between.

bproctor 3 years ago

I still regret missing Michael Scott's 05-05-05 party. It only happens once every billion years.

coding123 3 years ago

I wonder if there was a single person in 1922 that had the same thought.

  • 31337Logic 3 years ago

    ...or last year, on Nov. 12th.

    • quickthrower2 3 years ago

      or 11-11-11 11:11:11

      or 01-01-01 10:10:10

      Interview question: write a program to list them all!

      • yamtaddle 3 years ago

        > write a program to list them all!

        Me: Is it OK if it doesn't print until it's done?

        Interviewer: Uh, sure, why not?

        Me: while(1){}

        Me: Finished. This produces the exact desired output of the program you specified.

        Interviewer: GTFO.

        • quickthrower2 3 years ago

          while(1) {} is the universal program to do anything. You can then optimise performance later.

          Interestingly in Haskell the only pure program of type variable “a” where a means any type at all is the one that never quits:

              myProg: a
          
              myProg = myProg
          
          Which amounts to the same thing: it can do anything - produce any type - but it takes literally forever.
      • carl_dr 3 years ago

        Sounds like a great Code Golf contest.

        ruby -e 'require"date";a=DateTime.new(0,1,1,0,0,0);(0..4e9).each{|d|b=(a+Rational(d,86400));c=b.strftime("%y%m%d%H%M%S");puts b.strftime("%y-%m-%d %H:%M:%S")if c==c.reverse}'

        About the most inefficient anyone could make it, but I think it works!

        • AkshatJ27 3 years ago

          Some saves: `Rational(d,86400)` -> `d/86400r`

          Get rid of the variable `a` since it is used in only one place.

          `DateTime.new(0,1,1,0,0,0)` -> `DateTime.new(0,1,1)`

          also in newer ruby versions you can use numbered parameters to replace d with _1 and remove `|d|`

          Pretty sure there might be some more which i do not see immediately :)

          • carl_dr 3 years ago

            ruby -e 'require"date";(0..4e9).each{b=DateTime.new(0,1,1)+_1/86400r;c=b.strftime("%y%m%d%H%M%S");puts b.strftime("%y-%m-%d %H:%M:%S")if c==c.reverse}'

            151 bytes (including the ruby -e, down from 174.) Thanks!

            • AkshatJ27 3 years ago

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

              • carl_dr 3 years ago

                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.

                • AkshatJ27 3 years ago

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

                  • carl_dr 3 years 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!

                  • carl_dr 3 years ago

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

                    • AkshatJ27 3 years ago

                      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}'`

        • PinkMilkshake 3 years ago

          PowerShell 7, 108 chars

            0..2e9|%{date(date 0).AddSeconds($_)-f 'yy-MM-dd HH:mm:ss'}|?{$_-match'(.)(.)-(.)(.)-(.)(.) \6\5:\4\3:\2\1'}
        • lcnPylGDnU4H9OF 3 years ago

          Looks like it would be defeated by the dreaded leap second.

hirundo 3 years ago

2022-11-22 22:11:22.02

orliesaurus 3 years ago

happy 22-11-22 everyone, can't wait to wait for 23-11-23

kristianp 3 years ago

Where I am it's currently Fibonacci day: 11/23

subarctic 3 years ago

Coming up soon in UTC :)

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection