text:
Matrix Jigsaw Puzzle Pieces
(Randomly inspired by https://codegolf.meta.stackexchange.com/a/17272/42963)
Given a rectangular matrix of digits (i.e., 0 - 9), output the "pieces" of the matrix as if the digits are connected together forming a single piece, in ascending order by the digits. The pieces are guaranteed to connect only orthongonally -- no piece will connect diagonally. There will only ever be a maximum of 10 pieces (i.e., a 3 piece won't appear twice in the same matrix).
For example, given the matrix
0 1 1 1
0 0 1 2
3 3 2 2

the following are the pieces, and an example output:
0
0 0

1 1 1
  1

  2
2 2

3 3

Spacing is important to keep the shape of the pieces, but the pieces do not necessarily need interior spacing. The pieces themselves should somehow be made distinct in a consistent manner (e.g., a newline between pieces, making sure each is a different character, etc.). Additionally, extraneous whitespace (for example, trailing newlines or leading columns) are not allowed. For example, the following would also be valid:
0
00
111
 1
 2
22
33

or
#
##

###
 #

 #
##

##

But the following would not be (note the trailing spaces behind the 0s):
0
0 0

Rotations or reflections are also not allowed. For example, outputting
 1
111

for the above matrix is also invalid.
The matrix pieces may have holes, or be only a single element:
0 0 0 1
0 2 0 1
0 0 0 3

Or, the piece may be the whole matrix:
0 0 0
0 0 0

Here's a larger, more complicated test case:
1 1 1 1 1 2 2
3 4 4 4 2 2 2
5 5 4 4 2 0 0
5 6 6 6 6 7 7
5 6 8 8 6 6 7
9 6 6 6 7 7 7

And an example output:
00

11111

 22
222
2

3

444
 44

55
5
5

6666
6  66
666

 77
  7
777

88

9

Rules and I/O

Input and output can be given by any convenient method.
You can print it to STDOUT or return it as a function result.
Either a full program or a function are acceptable.
Leading whitespace to keep the shape (e.g., the "T" shape of the 1 in the example) is required, consistent whitespace to make the pieces distinct, and a single trailing newline at the end is allowed, but no other whitespace is permitted.
You can safely assume that the pieces are numbered 0 to N contiguously, meaning that (for example) 3 wouldn't be skipped in a six-piece matrix.
Standard loopholes are forbidden.
This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.

Can the output actually be a list of the pieces? Or I/O not be done with strings but with matrices and integers (with -1 or a space representing an empty space, or absence of an element if possible)?

Is it acceptable if the input is 1-based (doesn't contain zeros) and the output uses 0 as filler value? So each piece would be output with the rest of the values in the matrix set to 0

Independent of my previous question: no other whitespace is permitted: not even trailing spaces to make all lines equal length?

@EriktheOutgolfer Absence of an element would be OK, since that's outputting just the "piece" itself. Outputting an entire matrix for each piece with -1 or some other value instead of nothing/whitespace wouldn't be OK, though.

@AdmBorkBork Oh, so should the space (' ') be used in that case?

@LuisMendo If it's 1-indexed, how would you represent the last example? 1-10? That would mess up the output because the piece wouldn't be the right size? Regarding whitespace - yep, that's correct. No trailing whitespace allowed.

@EriktheOutgolfer Yep, that would be fine.

Do we need to support "pieces" that aren't all connected, such as in 010?

@AdmBorkBork No trailing whitespace to make lines equal length is an issue for array languages where the normal way to print multi-line text is to pad all lines with spaces until equal length, because arrays may not be ragged. Still prohibited for them?

Is something else instead of a space allowed in the output, as long as all trailing unnecessary characters are removed? I.e. 111\n01 instead of 111\n 1?

@KamilDrakari No, the pieces will always be connected orthogonally or a single character.

@Adám Yep. Guess that's a bummer for those languages.

@KevinCruijssen Given how others have answered this question already, I'm going to say "no."

@AdmBorkBork In that case the Japt answer is invalid, since it outputs true and false, instead of true and space.

Jelly, 18 bytes
ẎQṢ=€ẸƇZ$⁺œr€ɗ€0o⁶

Try it online!
Returns a list of pieces, where 1 represents a part of a piece, and ' ' is padding. Trailing ' 's are removed.

ẎQ=€ should do, although we need the pieces in ascending order, so 9Ż=€ (unless we must not include "non-existent pieces" in which case ẎQṢ=€)

@JonathanAllan Fixed the issue, although I'm pretty sure 9Ż=€ won't work (I think "extraneous whitespace [...] are not allowed" extends to arrays as well, that's why I'm trimming).

Yeah, that makes sense.

C# (.NET Core), 258, 238 bytes
Without LINQ.
EDIT:  Embodiment Of Ignorance pointing out better var declarations!  Ty ty.
p=>{int j=0,o=0,l=0,x=p.GetLength(1),d=p.Length;while(j<d){int t=j/x,u=j++%x,z=p[t,u];o=z>o?z:o;l=z<l?z:l;}var s="";for(var m=l;m<=o;m++){j=0;while(j<d){int t=j/x,u=j++%x;s+=(p[t,u]==m?p[t,u]+"":" ")+(u==x-1?"\n":"");}s+="\n";}return s;};

Try it online!

238 bytes

05AB1E, 20 19 bytes
ZƒNQ2Fζʒà}}ε0Ü}0ð:,

-1 byte thanks to @Mr.Xcoder.
Outputs 2D lists of pieces (with 1 and space characters " ") per newline.
Try it online or verify all test cases or pretty-print all test cases.
Explanation:
Z              # Get the maximum digit of the (implicit) matrix-input (implicitly flattens)
 ƒ             # Loop in the range [0, max]:
  NQ           #  Check for each digit in the (implicit) matrix if it's equal to the index
    2F    }    #  Inner loop two times:
      ζ        #   Zip/transpose; swapping rows/columns
       ʒ }     #   Filter the inner lists by:
        à      #    Get the max of the list
               #  (so all rows/columns containing only 0s are removed)
  ε  }         #  Map the remaining rows:
   0Ü          #   Remove all trailing 0s
  0ð:          #  Then replace any remaining 0 with a space " "
     ,         #  And output the piece-matrix with a trailing newline

Haskell, 133 132 129 bytes
f x=[until(any(>"!"))(tail<$>)m|m<-[[until((>'!').last)init r|r<-[[last$' ':[s|s==n]|s<-z]|z<-x],any(>'!')r]|n<-['0'..'9']],m>[]]

Takes the matrix as a list of strings and returns a list of list of strings.
Try it online!
                                    -- example matrix: ["0111","0012","3322"]
                                    --
[          |n<-[0..9]]              -- for each digit 'n' from '0' .. '9'
  [  |z<-x]                         --   for each line 'z' of the input matrix 'x'
   [      |s<-z]                    --     for each digit 's' of line 'z'
      last$' ':[s|s==n]             --       take 's' if 's'=='n', else a space
                                    --       now we have a list of 10 matrices where
                                    --       each matrix contains only the
                                    --       corresponding digit 'n' at it's original
                                    --       position and spaces for all other digits
                                    --       -> [["0   ","00  ","    "],[" 111","  1 ","    "],["    ","   2","  22"],["    ","    ","33  "],["    ","    ","    "],["    ","    ","    "],["    ","    ","    "],["    ","    ","    "],["    ","    ","    "],["    ","    ","    "]]
   [     |r<-[    ],any(>'!')r]     --     loop through rows 'r' and keep those with
                                    --     at least one non-space element
    until((>'!').last)init r        --     and remove trailing spaces
                                    --     -> [["0","00"],[" 111","  1"],["   2","  22"],["33"],[],[],[],[],[],[]]
   [     |m<-[   ],m>[]]            --   loop through matrices 'm' and keep only
                                    --   non-empty
    until(any(>"!"))(tail<$>)m      --   and remove common leading spaces
                                    --   -> [["0","00"],["111"," 1"],[" 2","22"],["33"]]

Python 3, 271 209 206 183 176 172 191 bytes
lambda t:[[[*"".join(' #'[i==d]for i in r).rstrip()]for r in[w[min(r.index(d)for r in t if d in r):max(len(R)-R[::-1].index(d)for R in t if d in R)]for w in t if d in w]]for d in{*sum(t,[])}]

Try it online!
Edit: Some cleanup and -5 thanks to @Jonathan Frech.
Edit: -3 -26 once again thanks to @Jonathan Frech.
Edit: -7 again thanks to @Jonathan Frech.
Edit: +19: As noted by @nimi previously output had incorrect format.

Input is matrix as list of lists:
Input =  [[0, 1, 1, 1],
          [0, 0, 1, 2],
          [3, 3, 2, 2]]

Output is list of matricies:
Output = [[['#'],
           ['#', '#']],
          [['#', '#', '#'],
           [' ', '#']],
          [[' ', '#'],
           ['#', '#']],
          [['#', '#']]],

Ungolfed:
O = ' '
X = '#'

def digits(t):
    return {d for r in t for d in r}

def rows_with_digit(table, digit):
    return [row for row in table if digit in row]

def table_with_digit(table, digit):
    subtable = rows_with_digit(table, digit)
    left_most_column = min([row.index(digit) for row in subtable])
    right_most_column = max([len(row) - row[::-1].index(digit) for row in subtable])
    return [row[left_most_column:right_most_column] for row in subtable]

def format_table(table, digit):
    return [[X if i==digit else O for i in row] for row in table]

def f(table):
    D = digits(table)
    R = []
    for d in D:
        digit_table = table_with_digit(table, d)
        R.append(format_table(digit_table, d))
    return R

176 bytes.

Python 2, 173 172 165 bytes
s=input()
for i in sorted(set(sum(s,[]))):R=[''.join([' ',i][c==i]for c in r)for r in s if i in r];print'\n'.join(t[min(r.find(i)for r in R):t.rfind(i)+1]for t in R)

Try it online!
-15 bytes from an observation by nimi.
In program form, takes as input a list of lists of single characters; outputs by printing the pieces found using their character.

@AdmBorkBork - Right, missed that criteria. Fixed now.

APL (Dyalog Unicode), 38 bytesSBCS
Anonymous tacit prefix function. Takes a numeric matrix as argument and returns a list of lists strings. Each list of strings represents a piece with space-separated 1s. Leading and internal (but not trailing) spaces are spaces.
⊂{' +$'⎕R''↓⍕' '@~{⍉⍵⌿⍨∨/⍵}⍣2⊢⍺=⍵}¨∪∘,

Try it online!
∪∘, the unique elements of the ravel (flattened) matrix
⊂{…}¨ for each of those as ⍵, call the following function with the entire matrix as ⍺:
 ⍺=⍵ indicate where that piece's number is in the matrix
 ⊢ yield that (separates 2 from ⍺)
 {…}⍣2 apply the following function twice (⍵ is the Boolean matrix):
  ∨/ mask for rows with at least one 1 (lit. row-wise OR-reduction)
  ⍵⌿⍨ use that to filter the rows
  ⍉ transpose (so we do this on the columns too, then transpose back)
 ' '@~ replace with spaces at positions where not (i.e. where 0)
 ⍕ format as character matrix
 ↓ split into list of strings
 ' +$'⎕R'' PCRE replace trailing spaces (any number of spaces followed by a line-end) with nothing

Python 2, 291 bytes
import re
t=input()
a,b=t.split(),{c for c in t if' '<c}
for c in sorted((b,a)[int(max(a))==len(a)],key=int):s=re.sub(r'[^%s\s]'%c,' ',t).split('\n');print"\n".join(''.join(l[i]for i in sorted({i for l in s for i,j in enumerate(l)if j in c})if i<len(l)).rstrip()for l in s if l.strip())+'\n'

Try it online!
Expects a quote-delimited sting as input. A semi-ludicrous percentage of the code is dedicated to handling non-space-separated/non-space-padded input.
Un-golfed Explanation:
# built-in python regex handling.
import re
# get argument from STDIN
t=input()
# get elements which are whitespace separated, and all distinct non-whitespace characters
a,b=set(t.split()),{c for c in t if' '<c}
                # choose whichever set has the appropriate number of values based on its max element
                # for non-space separated inputs, this prevents values like '333' for 4-piece sets
                (b,a)[int(max(a))==len(a)]
# get elements in order by their integer value
# this will force the items to print in order, since sets are unordered
for c in sorted(..........................,key=int):
      # using regex substitute, replace any instance that DOESN'T match the current value or a whitespace with a space
      re.sub(r'[^%s\s]'%c,' ',t)
    # split replaced string into lines on line breaks
    s=...........................split('\n')
                # for each line in replaced input
                for l in s
                           # get the index and value of each item in line
                           for i,j in enumerate(l)
             # get distinct indexes which have a value that appears in the current piece
             {i ..................................if j in c}
    # get ordered list of distinct indexes
    a=sorted(...............................................)
                                                               # for each line in the replaced input
                                                               # only return values where line has non-whitespace values
                                                               for l in s if l.strip()
                           # get the value for each index that has a non-space value on other lines
                           # as long as that index exists (for non-space-padded inputs)
                           # this ensures that the spaces between values, if any, are removed
                           # there may still be trailing spaces
                           l[i]for i in a if i<len(l)
                   # join characters back into one string, and remove trailing whitespace
                   ''.join(..........................).rstrip()
    # join the lines back together with line breaks, and terminate with an extra line break
    # print output to screen
    print"\n".join(...................................................................)+'\n'

You're allowed to specify the input format (e.g., as a list of lists, or as a space-separated paragraph) if it makes your code golfier.

Retina, 75 bytes
$
¶9
.-10{T`9d`d`.$
*;(s`(\d)(?!.*\1$)

 +¶
¶
G`\d
/^\d|^$/m^+m`^.

.$
$&¶

Try it online! Explanation:
$
¶9

Append a digit to the input. This represents the loop counter. The newline simplifies the trailing whitespace removal.
.-10{

Inhibit default output and repeat exactly 10 times.
T`9d`d`.$

Advance the loop digit.
*;(

Output the result of the rest of the script but then restore the buffer.
s`(\d)(?!.*\1$)

Replace all digits that don't match the loop digit with spaces. (Because this uses a lookahead and there's nothing to look ahead at this point this also replaces the loop digit.)
 +¶
¶

Remove all trailing whitespace.
G`\d

Remove all blank lines.
/^\d|^$/m^+

Repeat as long as no line begins with a digit...
m`^.

... delete the first character on each line.
.$
$&¶

If there is anything left then append a newline to separate each shape from the next. (This is done to avoid stray newlines for missing digits.)

There is guaranteed to never be a "missing digit" if that makes your code shorter.

@AdmBorkBork I don't think that would help. What would be more likely to help is not having to output the pieces in numerical order. Is that allowed?

No, that's half the challenge, otherwise it'd be too easy. ;-)

Charcoal, 43 bytes
ＷＳ⊞υιＦχ«≔Φυ№κＩιθ¿θ«ＵＴＦθ«Ｆκ«¿⁼λＩιλ→»Ｍ±Ｌκ¹»Ｄ⎚

Try it online! Link is to verbose version of code. Explanation:
ＷＳ⊞υι

Read the input into an array. (This could be removed if I used an ugly input format.)
Ｆχ«

Loop over the 10 digits.
≔Φυ№κＩιθ

Get the rows which contain those digits.
¿θ«

Check that the digit was in fact found (to prevent outputting spurious newlines).
ＵＴ

Turn off automatic padding.
Ｆθ«

Loop over the found rows.
Ｆκ«

Loop over each column...
¿⁼λＩιλ→»

... if the current input character equals the current loop digit then print it otherwise move the cursor right.
Ｍ±Ｌκ¹»

Move to the start of the next row. Using movement commands like this allows Charcoal to trim the output on both sides.
Ｄ⎚

Dump and clear the canvas ready for the next digit. This allows the different digits to have different amounts of trimming.
I tried a programmatic approach but that weighed in at 47 bytes, although it would also have been 43 bytes for a brief amount of time when Equals vectorised:
ＵＴＷＳ⊞υιＦχ«≔ΦＥυＥκ⁼μＩιΣκθＥθ⭆✂κ⌊Ｅθ⌕μ¹⁻Ｌκ⌕⮌κ¹¦¹⎇μι

Try it online! Link is to verbose version of code. Explanation:
ＵＴ

Turn off automatic padding.
ＷＳ⊞υι

Read the input into an array.
Ｆχ«

Loop over the 10 digits.
≔ΦＥυＥκ⁼μＩιΣκθ

Compare each character with the input and build up a boolean array, but then filter out the rows with no matches.
Ｅθ⭆✂κ⌊Ｅθ⌕μ¹⁻Ｌκ⌕⮌κ¹¦¹⎇μι

Loop over the remaining rows and slice from the earliest match in any row to the latest match in the current row, then mapping the boolean array back to digits or spaces, which are then implicitly printed as an array of strings.

Wolfram Language 101 bytes
There has got to be a much more efficient way to accomplish this.
(g=#;Column[Table[Grid@Map[Replace[#,Thread[Complement[u=Union@Flatten@g,{n}]->""]]&/@#&,g],{n,u}]])&

Perl 5, 97 bytes
$x=$_;for$i(0..9){$_=$x;y/ //d;s/(?!$i)./ /g;s/ *$//gm;s/^
//gm;s/^ //gm until/^(?! )/m;$\.=$_}}{

TIO
Explanation
-p0777                       # options to read whole intput and print special var by default

$x=$_;                       # save default var (input) into $x
for$i(0..9){                 # for $i in 0..9
    $_=$x;                   #   restore default var
    y/ //d;                  #   remove all space char
    s/(?!$i)./ /g;           #   replace all char except $i by a space
    s/ *$//gm;               #   remove trailing space
    s/^\n//gm;               #   remove empty lines
    s/^ //gm until/^(?! )/m; #   remove leading space until there is no more
    $\.=$_                   #   append default var to output record separator
}
}{                           # trick with -p to output only reacord separator

Japt, 29 bytes
AÆ®®¥X ÑÃÃÕfx Õfx ®¬r0S x1
fl

Try it online!
Updated to comply with stricter output formatting.
Outputs as a list of pieces with each piece represented by a list of lines, using 2 as the filler character.
Explanation:
AÆ                            #For the numbers 0-9:
  ®®    ÃÃ                    # Map over each digit in the input:
    ¥X                        #  True if it equals the current number, false otherwise
       Ñ                      #  Multiply by 2 to turn the bool into a number
          Õfx                 # Remove columns that are all 0
              Õfx             # Remove rows that are all 0
                  ®           # For each remaining row:
                   ¬          #  Turn it into a string
                    r0S       #  Replace "0" with " "
                        x1    #  Trim spaces from the right
fl                            #Remove unused pieces

You forgot to remove all trailing false from the inner lists. Here a pastebin so I can better explain what's supposed to be the output. Feel free to ask OP to clarify, but as far as I understand from the challenge, all trailing whitespaces shouldn't be there in the output at all.

Python 3, 133 bytes
lambda s:[dedent(re.sub(" *$","",re.sub(f"[^{c}\\n]"," ",s),0,8)).strip("\n")for c in sorted(*s)[1:]]
from textwrap import*
import re

Try it online!
Takes a newline-seperated string, returns a list of newline-seperated strings.
Uses textwrap.dedent to get rid of leading spaces.

@AdmBorkBork Overlooked that rule, fixed

Jelly, 19 bytes
ŒĠµŒṬZSƇ$⁺ị⁾# œr€⁶)

Try it online!
A monadic link taking the matrix as input and returning a list of one ragged list per piece. Footer displays this prettily, but I think output without that is consistent with rules of question.


text:
Unix timestamp to datetime string
Given a unix timestamp as an input, give a datetime string, in a format like so: "YYMMDD.HHmm"
Rules

The input is a number (integer) of a millisecond-precise UNIX epoch time (milliseconds since 1970 January 1st 00:00:00.000 UTC).
The values must be padded with zeroes if they are 1 character instead of 2. (e.g.: for "DD", "1" is not acceptable, but "01" is.)
The output must be a single string. No arrays.
Leap second handling doesn't matter.
Shortest wins.

Good luck!
Example
Input: 1547233866744
Output: 190111.1911

Welcome to PPCG! Nice challenge, but there are a few clarifications to be made. To make the challenge self-contained, you should probably explain what the Unix epoch is. Additionally, what should be done with leap seconds? What should be done with the Year 2038 problem?

@AdmBorkBork Edited the post to explain what the Unix epoch is. Leap second implementation doesn't matter, since the output string is not second-precise. The Year 2038 problem doesn't currently matter since it could be a limitation of the running device or the chosen programming language.

Does the timezone matter?

I take it the year is represented by a two digit number?

Can you add a few more test cases?

@skiilaa the leap second could still cause the minute to “tick” over. If you give a value that’s 5s away from a minute, and someone doesn’t handle the leap seconds correctly, they could calculate a value in the next minute...

Are builtins allowed? Because if not, the only valid and completely correct programs are probably on the order of millions of characters. See here why timezones and time special cases cause madness: https://www.youtube.com/watch?v=-5wpm-gesOY

@EriktheOutgolfer no.

@EmbodimentofIgnorance yes.

@Tim it doesn't matter.

@FabianRöling timezones don't matter.

What range of times stamps need to work = can we drop timestamps before year 2000?

@chux, See rule #1.

@Shaggy Rulle #1 describes the offset and scale of the time stamp - not the acceptable range.  The range certainly can be thought of as from 0 upward, but the requirement for a 2 digit year implies an alternate range may be acceptable, as in timestamps of 20xx.  IAC, I was hoping to here from OP.

@chux just get the last two digits of the year count

@skiilaa, Yes, well understand the desire output format of 2 digits, but over what range?  Is 2000-2099 sufficient? Or are  years before 2000, after 2099 needed?

@chux literally get the last two characters of the full year converted to a string

Japt v1.4.5, 19 16 bytes
GîÐU s3)¤o>J i.G

1 byte saved thanks to Oliver, which led to another 2 bytes saved.
Try it

Explanation
GîÐU s3)¤o>J i.G
                     :Implicit input of integer U
G                    :16
 î                   :Get the first 16 characters of the following string
  ÐU                 :  Convert U to a date object
     s3              :  Convert to ISO string
       )             :End get
        ¤            :Slice off the first 2 characters
         o           :Filter
          >J         :  Greater than -1
             i.G     :Insert "." at 0-based index 16, with wrapping

Notes / Tips

Getting the first 16 characters of the ISO string and then slicing off the first two is a byte shorter than performing a single slice.
G is used to insert the . at the required index because using a literal 6 would cause it to be combined with the . and for that to be interpreted as a decimal that would be inserted at the start of the string. To get around that I'd need to add a ' before the . to force it to be interpreted as a string.
Japt v1.4.5 is used because Japt doesn't have a constant for 17 and from v1.4.6 on trying to insert something at the first index past the end of a string results in it being inserted at the end of the string (A is the Japt constant for 10) whereas prior to v1.4.6 it immediately wraps back to the beginning of the string.

JavaScript (ES6), 65 bytes
n=>'101010.1010'.replace(i=/\d/g,x=>new Date(n).toJSON()[i=x-~i])

Try it online!
How?
We initialize the pointer \$i\$ to a non-numeric value (coerced to \$0\$) and then add alternately \$2\$ and \$1\$ to it to pick the relevant characters from the ISO-8601 conversion of the input timestamp.
yyyy-mm-ddThh:mm:ss.sssZ
  ^^ ^^ ^^ ^^ ^^

JavaScript (ES6), 66 bytes
n=>'235689.BCEF'.replace(/\w/g,x=>new Date(n).toJSON()[+`0x${x}`])

Try it online!
How?
Once the input timestamp is converted in ISO-8601 format, all required characters can be accessed with a single hexadecimal digit.
yyyy-mm-ddThh:mm:ss.sssZ
  ↓↓ ↓↓ ↓↓ ↓↓ ↓↓
0123456789ABCDEF

Wow. Just, wow.

64 bytes: n=>'235689.11121415'.replace(/1?\w/g,x=>new Date(n).toJSON()[x])

@tsh Nice! I was not expecting the decimal format to be shorter. You may want to post this as a separate answer.

Bash + coreutils, 29 bytes
date -d@${1::-3} +%y%m%d.%H%M

Try it online!

PHP, 40 32 31 bytes
-8 bytes thanks to Luis felipe
-1 byte thanks to Jo King
<?=date('ymd.hi',$argv[1]/1e3);

Try it online!
Simple naive answer. PHP's date function takes a format string and an integer timestamp. Input from cli arguments, which is a string by default, then /1e3 because date expects second-precise timestamps. This also coerces the string to a number.

Nice answer! It's a tad shorter if the language has date formatting, yes :)

32 bytes you dont need to cast to integer since "2"/1 will cast automatically the string

ah of course, I added intval before realising I needed /1000, and didn't think that I mihgt not need it afterwards :P

@JoKing ah nice one, thanks

PowerShell, 59 58 bytes
"{0:yyMMdd.HHmm}"-f(Date 1/1/1970).AddSeconds("$args"/1e3)

Try it online!
Gets the Date of 1/1/1970 (defaults to 00:00:00am), then Adds the appropriate number of Seconds. Passes that to the -format operator, which correctly formats the datetime.
Probably culture-dependent. This works on TIO, which is en-us.
-1 byte thanks to shaggy.

MATL, 28 bytes
Thanks to @skiilaa for a correction in the output format.
864e5/719529+'YYmmDD.HHMM'XO

Try it online!
Explanation
MATL, like MATLAB, defines date/time numbers as the (possibly non-integer) number of days since time 00:00 of the reference "date" 0-Jan-0000.
Thus we take the input, divide it by 86400000 (number of milliseconds in one day), add 719529 (number of days from MATL's reference to UNIX reference), and convert to the desired format 'YYmmDD.HHMM'.

GNU AWK, 34 33 characters
$0=strftime("%y%m%d.%H%M",$0/1e3)

(strftime() is GNU extension, will not run in other AWK implementations.)
Thanks to:

Jo King for suggesting E-notation (-1 character)

Sampler run:
bash-4.4$ awk '$0=strftime("%y%m%d.%H%M",$0/1e3)' <<< 1547233866744
190111.2111

Try it online!

Thank you, @JoKing. Unfortunately E-notation is not really my friend so I always forget it.

Perl 6,  111 89  87 bytes
{~DateTime.new($_/Ⅿ,:formatter{"{(.year%Ⅽ,.month,.day).fmt('%02d','')}.{(.hour,.minute).fmt('%02d','')}"})}

Try it (111)
{TR/-//}o{S/..//}o{.yyyy-mm-dd~'.'~(.hour,.minute).fmt('%02d','')}o{DateTime.new($_/Ⅿ)}

Try it (89)
{TR/- //}o{S/..//}o{.yyyy-mm-dd~'.'~(.hour,.minute).fmt('%02d')}o{DateTime.new($_/Ⅿ)}

Try it (87)
Explanation:
The o infix operator takes two functions and creates a composite function. The rightmost one gets called first, and the one to the left gets called with its result.
Basically we use 4 block lambdas to generate a single lambda.
Which is not much different to how a WhateverCode lambda like * + * gets created.

Divide by 1000 and use that to create a DateTime object.
{DateTime.new($_/Ⅿ)} # Ⅿ is ROMAN NUMERAL ONE THOUSAND (3 bytes)

The result gets used by:
{
   .yyyy-mm-dd # 2019-01-11

   ~ '.' ~     # str concatenation with '.'

   ( .hour, .minute ).fmt('%02d') # add leading 0s (returns List)
}

That leaves us with a string like 2019-01-11.19 11
We need to remove the first two digits
{S/..//}

We also need to remove - and
{TR/- //}

Python 2, 64 bytes
lambda s:strftime('%y%m%d.%H%M',gmtime(s/1e3))
from time import*

Try it online!
The input is considered to be in UTC.

Just as something I've been a bit confused on, is the only reason that the lambda comes before the import because it works better for TIO's header?

@NeilA. Yes. The import can go either before or after, the contents of the lambda aren't checked for NameErrors before it's called.

R, 58 56 bytes
format(as.POSIXct(scan()/1e3,,'1970-1-1'),'%y%m%d.%H%M')

Try it online!

C (gcc) (32-bit, little endian), 67 bytes
f(t,s)long long t;{t/=1e3;strftime(s,12,"%y%m%d.%H%M",gmtime(&t));}

Try it online!
On an ILP64 platform, the following 55 byte version should work:
f(t,s){t/=1e3;strftime(s,12,"%y%m%d.%H%M",gmtime(&t));}

What's the extra s argument you're taking for?

@Shaggy The s is for the output string.

It looks like you're initiating it outside the function; do we have a meta consensus that allows C to do that?

@Shaggy I'm not sure what "consensus" means exactly but here's the relevant meta post.

With "32-bit,", why long long instead of long or int32_t, int64_t, time_t? IAC, all shorter than long long.

@chux long long doesn't require to include a header file and a 32-bit type wouldn't be large enough for the input.

Hmm I was thinking, "32-bit, little endian" allowed I32LP64 and t passed as at least long.  UV for the nice effort.

Javascript ES6, 76 66 bytes
x=>new Date(x).toJSON().slice(2,16).replace(/\D/g,a=>a>'S'?'.':'')

Try it online
-10 bytes thanks to Shaggy!

x // timestamp
=>
new Date(x) // date object from timestamp
.toJSON() // same as .toISOString()
.slice(2,16) // cut off excess
.replace(/\D/g, // match all non-digits
a // a is matched character
=>
a>'S'?'.' // if a is T (bigger than S is shorter) replace it with .
:''       // if it's not T, replace it with nothing
          // this way the dashes get removed and the dot gets put in the right place
) // end of replace

You may want to wait a day or so before answering your own questions next time.

71 bytes

Alternative 71 bytes

@LuisfelipeDejesusMunoz, that's different enough for you to post yourself.

@LuisfelipeDejesusMunoz 66 bytes to tie you with Arnauld.

C# (Visual C# Interactive Compiler), 67 61 60 bytes
n=>$"{new DateTime(1970,1,1).AddTicks(n*10000):yyMMdd.HHmm}"

For reasons unknown to me, DateTime.UnixEpoch doesn't work.
Try it online!

It seems UnixEpoch is only present in.Net Core 2.1+

Perl 6, 57 50 bytes
{TR:d/T:-/./}o{substr ~DateTime.new($_/1e3): 2,15}

Try it online!
Takes the default stringification of a Datetime, in the format yyyy-mm-ddThh:mm:ssZ and modifies it to fit the output format. Perl 6 is in need of a date formatter method.
Explanation:
                       Datetime.new($_/1e3) # Create a date time
                      ~                 # Stringify it to the format yyyy-mm-ddThh:mm:ssZ
                                        # e.g. 2019-01-11T19:11:06.744000Z
               substr                      : 2,15  # Take the middle 15 characters
 {TR:d/T  /./}o   # Then replace 'T' with '.'
        :-        # Then remove ':' and '-'

C (clang), 117 111 bytes
Thanks to @chux and @ceilingcat for the suggestions.
#import<time.h>
*l;f(long t){t/=1e3;printf("%02d%02d%02d.%02d%02d",5[l=gmtime(&t)]%100,l[4]+1,l[3],l[2],l[1]);}

Try it online!

gmtime is short than localtime

Twig, 25 characters
{{d[:-3]|date('ymd.hi')}}

This is a template. Call it by including it and pass the Unix time as parameter d.
Sample usage:
{{include('datetime.twig', {'d': 1547233866744})}}

Try it on TwigFiddle

JavaScript, 64 bytes
n=>'2356891911121415'.replace(/1?./g,x=>new Date(n).toJSON()[x])

Try it online!

aw, so close

also 64

Java 8, 78 bytes
n->new java.text.SimpleDateFormat("yyMMdd.HHmm").format(new java.util.Date(n))

Try it online.
Explanation:
n->                       // Method with long parameter and String return-type
  new java.text.SimpleDateFormat("yyMMdd.HHmm")
                          //  Create the formatter
   .format(               //  Format the date to a String in this format and return it:
     new java.util.Date(  //   Create a new Date
      n))                 //   With the input-long as timestamp

jq, 33 characters
(30 characters code + 3 characters command line option)
./1000|strftime("%y%m%d.%H%M")

Sample run:
bash-4.4$ jq -r './1000|strftime("%y%m%d.%H%M")' <<< 1547233866744
190111.1911

Try it online!

You don't need to count command-line flags anymore.

Oops. Good to know. Thank you @AdmBorkBork.

1000 -> 1e3

ksh, 36 bytes
printf "%(%y%m%d.%H%M)T" $(($1/1e3))

Try it online!
Thanks to Jo King for 15 bytes saved

The same in Bash would be just 35 characters: Try it online!

MediaWiki, 46 bytes
{{#time:ymd.Hi|@{{#expr:floor({{{1}}}/1e3)}}}}

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Matrix Jigsaw Puzzles
Input:

An integer n
Two equal-sized square matrices (with their width/height being a multiple of n)

Output:
One of two distinct values of your own choice, one being for truthy results and one for falsey results (so yes, 1/0 instead of true/false are valid outputs for languages like Java, even though they're not considered official truthy/falsey values).
The truthy/falsey output indicates whether we can rearrange blocks of size n by n in one matrix to make it equal to the other matrix.
Example:
Input:
Matrix 1:
1 2 3 4 5 6
7 8 9 0 1 2
3 4 5 6 7 8
9 8 7 6 5 4
3 2 1 0 9 8
1 1 1 1 1 1

Matrix 2:
3 2 9 8 7 8
1 1 1 1 5 4
3 4 5 6 1 0
9 0 7 6 1 1
5 6 1 2 3 4
1 2 7 8 9 8

Integer n:
2

Output: truthy
Why?
If we split the matrices in blocks of 2 by 2, we can see that all blocks on one matrix can also be found in the other matrix:
Matrix 1:
1 2 | 3 4 | 5 6
7 8 | 9 0 | 1 2
---------------
3 4 | 5 6 | 7 8
9 8 | 7 6 | 5 4
---------------
3 2 | 1 0 | 9 8
1 1 | 1 1 | 1 1

Matrix 2:
3 2 | 9 8 | 7 8
1 1 | 1 1 | 5 4
---------------
3 4 | 5 6 | 1 0
9 0 | 7 6 | 1 1
---------------
5 6 | 1 2 | 3 4
1 2 | 7 8 | 9 8

Challenge rules:

You can assume the matrices will only contain non-negative digits (range [0,9])
You can assume the width/height of the matrices are equal, and a multiple of n
You can assume n will be in the range [1, 50], and the width/height of the matrices are in the range [1,100].
The individual blocks of n by n can only be used once to determine if the matrices are permutations of each other when split into blocks of n by n.
There can be multiple n by n blocks that are the same.
The n by n blocks will remain in the same orientation when checking if the two matrices are permutation of each other when split into blocks of n by n.

General rules:

This is code-golf, so shortest answer in bytes wins.
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
Standard rules apply for your answer with default I/O rules, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters and return-type, full programs. Your call.
Default Loopholes are forbidden.
If possible, please add a link with a test for your code (i.e. TIO).
Also, adding an explanation for your answer is highly recommended.

Test cases:
Input:
Matrix 1:       Matrix 2:       Integer:
1 2 3 4 5 6     3 2 9 8 7 8     2
7 8 9 0 1 2     1 1 1 1 5 4
3 4 5 6 7 8     3 4 5 6 1 0
9 8 7 6 5 4     9 0 7 6 1 1
3 2 1 0 9 8     5 6 1 2 3 4
1 1 1 1 1 1     1 2 7 8 9 8
Output:
truthy

Input:
Matrix 1:       Matrix 2:       Integer:
1 2 3 4 5 6     3 2 9 8 7 8     1
7 8 9 0 1 2     1 1 1 1 5 4
3 4 5 6 7 8     3 4 5 6 1 0
9 8 7 6 5 4     9 0 7 6 1 1
3 2 1 0 9 8     5 6 1 2 3 4
1 1 1 1 1 1     1 2 7 8 9 8
Output:
truthy

Input:
Matrix 1:       Matrix 2:       Integer:
1 2 3 4 5 6     3 2 9 8 7 8     3
7 8 9 0 1 2     1 1 1 1 5 4
3 4 5 6 7 8     3 4 5 6 1 0
9 8 7 6 5 4     9 0 7 6 1 1
3 2 1 0 9 8     5 6 1 2 3 4
1 1 1 1 1 1     1 2 7 8 9 8
Output:
falsey

Input:
Matrix 1:    Matrix 2:    Integer:
1 2 3 4      1 2 3 4      4
2 3 4 5      2 3 4 5
3 4 5 6      3 4 5 6
4 5 6 7      4 5 6 7
Output:
truthy

Input:
Matrix 1:    Matrix 2:    Integer:
1 2 3 4      3 4 3 4      2
2 3 4 5      4 5 4 5
3 4 5 6      1 2 5 6
4 5 6 7      2 3 6 6
Output:
falsey

Input:
Matrix 1:    Matrix 2:    Integer:
1 2          2 3          1
3 4          1 1
Output:
falsey

Input:
Matrix 1:    Matrix 2:    Integer:
0            8            1
Output:
falsey

Input:
Matrix 1:    Matrix 2:    Integer:
1 2 3 4      1 2 1 2      2
5 6 7 8      5 6 5 6
9 0 0 9      0 9 9 0
4 3 2 1      2 1 4 3
Output:
falsey

Input:
Matrix 1:    Matrix 2:    Integer:
1 2 1 2      9 5 1 2      2
3 4 3 4      7 7 3 4
8 3 9 5      1 2 8 3
6 1 7 7      3 4 6 1
Output:
truthy

Input:
Matrix 1:      Matrix 2:      Integer:
1 0 2 0 0 3    1 1 1 0 0 3    2
1 1 1 1 1 1    2 0 1 1 1 1
2 2 2 2 2 2    2 2 2 2 2 2
3 3 3 3 3 3    3 3 3 3 3 3
4 4 4 4 4 4    4 4 4 4 4 4
5 5 5 5 5 5    5 5 5 5 5 5
Output:
falsey

Pastebin with matrices in [[,]] format.

Can we take the matrices as a list of matrices?

@JoKing You mean a list with both matrices instead of two separated matrix-inputs? If that's what you're asking, then sure, why not.

Loosely related subset.

Why is the example [ [ 0 ] ], [ [ 25 ] ], 1 present? I understood with You can assume the matrices will only contain non-negative digits (range [0,9]) that the matrix values are only between 0 and 9?

@OlivierGrégoire Sorry, added that rule about range [0,9] later on in the Sandbox. I've changed the test case to [[0]],[[8]].

Jelly,  10  9 bytes
ż⁹/ẎsṢʋ€E

Try it online! (or with pre-processing for easier copy & paste from the test cases)
A dyadic Link accepting a list of the two matrices (as lists of lists) on the left and the integer on the right which yields 1 or 0 for truthy or falsey respectively.
How?
ż⁹/ẎsṢʋ€E - Link: [M1, M2]; N
       €  - for each of [M1, M2]:
      ʋ   -   last four links as a dyad (i.e. f(M, N)):
 ⁹        -     (chain's right argument, N)
 ⁹/       -     N-wise-reduce with:
ż         -       zip together
   Ẏ      -     tighten
    s     -     split into chunks of length N
     Ṣ    -     sort
        E - equal?

APL (Dyalog Extended), 19 18 17 bytes
-2 thanks to ngn.
Anonymous tacit infix function. Takes n as left argument and list of two matrices as right argument. Requires zero-indexing (⎕IO←0). Incidentally, this function works on arrays of any number of dimensions.
≡.{∧,⍵⊂⍨⊂0=⍺|⍳≢⍵}

Try it online!
≡.{…} identical results of the following function applied to each matrix ⍵ with n as ⍺?
 ≢⍵ size of matrix
 ⍳ indices 0…size–1
 ⍺| division remainder when divided by n
 ⊂ enclose to use along all dimensions
 ⍵⊂⍨ use that to partition* the matrix into a matrix of submatrices
  * begins new partition when corresponding element is less than the previous; removes elements marked by zero
 , ravel the matrix into a list of submatrices
 ∧ sort ascending

(≢⍵)⍴⍺↑1 -> 0=⍺|⍳≢⍵ (with ⎕io←0)

@ngn Thanks. Done.

≡/{}¨ -> ≡.{}

@ngn Done. Thanks.

Python 2, 108 103 bytes
lambda s,*a:len(set(`sorted(sum([zip(*[iter(zip(*l))]*s)for l in zip(*[iter(m)]*s)],[]))`for m in a))<2

Try it online!

Perl 6, 94 68 63 bytes
{[eqv] map *.rotor($^a).map({[Z] $_}).flat.rotor($a²).sort,@_}

Try it online!
Anonymous code block that takes input as size, [matrix1, matrix2] and returns a boolean True/False. There might be a more efficient way of splitting the matrix into chunks than rotor.
Explanation:
{                                                            }  # Anonymous code block
       map                                                ,@_   # For both matrices
           *.rotor($^a)   # Split the matrix into N sized chunks
                       .map({[Z] $_})  # Then zip each of those chunks together
                                     .flat  # Flatten the resulting list
                                          .rotor($a²)  # Then split into the NxN lists
                                                     .sort   # And sort them
 [eqv]    # And then check if the lists are equivalent

05AB1E, 14 bytes
εε²ô}ø˜²ô²ô{]Ë

Try it online!

JavaScript (ES6), 88 bytes
(n,a,b)=>(g=a=>a.map((r,y)=>r.map((v,x)=>o[y/n<<7|x/n]+=[v]),o=[])&&o.sort()+o)(a)==g(b)

Try it online!
How?
This code is:

extracting all sub-matrices in each input matrix as a concatenation of cells
sorting the sub-matrices in lexicographical order
testing whether the result is the same for both input matrices

It is taking advantage of the limits described in the challenge:

A matrix consists of single digits, so we can just concatenate all cells of a sub-matrix without any separator and still get a unique representation of it (e.g. [[1,2],[3,4]] can be stored as "1234").

The width of the input matrices is less than or equal to \$100\$. To convert the coordinates \$(x,y)\$ in an input matrix into a unique slot index \$I\$ in our storage area, we can do:
$$I=\left\lfloor\frac{y}{n}\right\rfloor\times128+\left\lfloor\frac{x}{n}\right\rfloor$$
or as JS code: y / n << 7 | x << n

Commented
(n, a, b) =>           // n, a, b = input variables (integer, matrix 1, matrix 2)
  (g = a =>            // g = helper function taking one of the two matrices
    a.map((r, y) =>    // for each row r[] at position y in a[]:
      r.map((v, x) =>  //   for each value v at position x in r[]:
        o[             //     update o[]:
          y / n << 7 | //       the position of the slot is computed by taking advantage
          x / n        //       of the limit on the matrix width (see above)
        ] += [v]       //     coerce v to a string and append it to o[slot]
                       //     all slots are initially undefined, so all resulting strings
                       //     are going to start with "undefined", which is harmless
      ),               //   end of inner map()
      o = []           //   start with o = empty array
    ) &&               // end of outer map()
    o.sort() + o       // sort o[] and coerce it to a string by concatenating it with itself
  )(a) == g(b)         // test whether g(a) is equal to g(b)

TSQL, 164 bytes
Populating a table variable in order to have input, this creating input and inserting data has not been included in the byte count. Only the actual query to extract the data.
Golfed(not including test table - it can be found in the ungolfed version):
SELECT iif(exists(SELECT*FROM(SELECT string_agg(v,'')within
group(order by x,y)s,m FROM @t GROUP BY x/@,y/@,m)x
GROUP BY s HAVING max(m)=min(m)or sum(m-.5)<>0),0,1)

Ungolfed:
-- test data
DECLARE @ INT = 2
-- x = x-position of the input
-- y = y-position of the input
-- v = value
-- m = matrix(0 or 1)
DECLARE @t table(x int, y int, v int, m int)
--insert first matrix values
INSERT @t values
(0,0,1,0),(0,1,2,0),(0,2,1,0),(0,3,2,0),
(1,0,3,0),(1,1,4,0),(1,2,3,0),(1,3,4,0),
(2,0,8,0),(2,1,3,0),(2,2,9,0),(2,3,5,0),
(3,0,6,0),(3,1,1,0),(3,2,7,0),(3,3,7,0)
INSERT @t values
(0,0,9,1),(0,1,5,1),(0,2,1,1),(0,3,2,1),
(1,0,7,1),(1,1,7,1),(1,2,3,1),(1,3,4,1),
(2,0,1,1),(2,1,2,1),(2,2,8,1),(2,3,3,1),
(3,0,3,1),(3,1,4,1),(3,2,6,1),(3,3,1,1)

-- query
SELECT iif(exists
  (
    SELECT *
    FROM
    (
      SELECT string_agg(v,'')within group(order by x,y)s,m
      FROM @t
      GROUP BY x/@,y/@,m
    ) x
    GROUP BY s
    HAVING max(m)=min(m)or sum(m-.5)<>0
  ),0,1)

Try it out

Java (JDK), 217 bytes
(n,a,b)->{java.util.Arrays A=null;int l=a.length,x=l/n,j=0,z;var c=new String[x*x];A.fill(c,"");var d=c.clone();for(;j<l*l;d[z]+=b[j/l][j++%l])c[z=j/l/n+j%l/n*x]+=a[j/l][j%l];A.sort(c);A.sort(d);return A.equals(c,d);}

Try it online!
Explanation
The idea is to pick each small cell as a string, which is comparable, and then to sort those strings and compare them in order.
(n,a,b)->{
 java.util.Arrays A=null;             // Shortcut A for the several java.util.Arrays that'll come
 int l=a.length,x=l/n,i=0,j,z;        // Variable declarations
 var c=new String[x*x];               // Declare the small squares list
 A.fill(c,"");                        // Fill the lists of small squares with the empty string.
 var d=c.clone();                     // Make a copy of the list, for the second matrix
 for(;i<l;i++)
  for(j=0;j<l;d[z]+=b[i][j++])        // For each matrix cell
   c[z=i/n+j/n*x]+=a[i][j];           // Fill the small square with the value, string-wise
 A.sort(c);A.sort(d);                 // Sort both small squares list
 return A.equals(c,d);                // Return true if they're equal, false otherwise.
}

Note: some lines are obsolete.
Credits

-12 bytes thanks to Kevin Cruijssen!
-4 bytes thanks to ceilingcat.

Did you forgot to golf for(j=0;j<l;){c[z=i/n+j/n*x]+=a[i][j];d[z]+=b[i][j++];}?.. You can remove the brackets by putting everything inside the loop. Also, the i=0 in the loop can be removed, because your i is already 0 at declaration.

And one thing to actually golf: var d=new String[x*x]; can be var d=c.clone(); instead. 234 bytes

PS: Why does your TIO contains String which you convert to 2D-integer arrays? I've added a paste-bin with the test cases at the bottom, for which you can replace the [ and ] with { and } and add a leading new int[][], and it would have been enough. ;)

Dammit, I hadn't seen the paste-bin :( And for the rest, I'm still golfing. I did a rough pass, but thank you :-)

The i=0 was a remnant when I filled the arrays by myself rather than using Arrays.fill. Thanks :-) And for the clone I thought about using it, but I still thought it'd have returned anObject and not the actual type. I must be several versions late on that point ;)

Glad I could help. :) And sorry the pastebins weren't as noticeable as they should have been..

Japt, 18 bytes
®mòV yòV rc n qÃr¥

Try it online!
Explanation:
®              Ã      #Apply this to each of the input matrices:
 mòV                  # Split each row into groups of n
     yòV              # Split each column into groups of n
         rc           # Flatten into a list of nxn submatrices
            n         # Sort that list
              q       # Turn it into a string
                r¥    #Return true if both matrices had identical results

The "Turn it into a string" step is necessary because Japt doesn't compare arrays by value and the builtin to work around that doesn't work for multidimensional arrays.

I'll see if I can make some time between meetings tomorrow to try and get A.e() working for multi-dimensional arrays; always meant to come back to it. In the meantime ÕmòV -> yòV will save you a byte.

By the way, the limitation on comparing arrays for equality is JavaScript's rather than being particular to Japt ;)

Charcoal, 54 49 bytes
1ＦθＦ⪪ιηＦ÷Ｌ§κ⁰η⊞υＥκ§⪪μηλＷ∧υ⊟υ¿№✂υ⁰⊘⊕Ｌυ¹ι≔Φυ⁻⌕υιλυ⎚

Try it online! Link is to verbose version of code. Takes input as an array of equal-sized two-dimensional arrays. Outputs 1 on success, nothing on failure. Explanation:
1

Assume success.
Ｆθ

Loop over the arrays.
Ｆ⪪ιη

Divide the array into n-sized row chunks.
Ｆ÷Ｌ§κ⁰η

Loop over each column chunk.
⊞υＥκ§⪪μηλ

Extract the column chunk for each row of the row chunk and save the resulting submatrix in a list.
Ｗ∧υ⊟υ

While the list is nonempty, remove the last chunk of the list, which under normal circumstances comes from the second array.
¿№✂υ⁰⊘⊕Ｌυ¹ι

Count the number of occurrences of that chunk in the first half of the list, which under normal circumstances contains the remaining chunks from the first array.
≔Φυ⁻⌕υιλυ

If nonzero then remove the first occurrence of that chunk from the list.
⎚

If zero then clear the output, making it falsy.

J, 55 bytes
[:-:/[([:/:~([*-@[)]\,@])"3(((;])@(#@]$1{.~[),;.1])&>])

Try it online!
A horrible solution, just made it work - I have no power to golf it...

29 bytes

@Jonah Thanks! Feel free to post it separately.

Haskell, 74 73 bytes
import Data.Lists
i#m|c<-chunksOf i=c.transpose=<<c m
(m!n)i=i#m\\i#n==[]

Note: TIO hasn't installed Data.Lists, so I'm using Data.List instead an add the missing function chunksOf: Try it online!
i#m=           -- function '#' makes a list of all transposed jigsaw blocks of matrix 'm'
               -- of size 'i'
 c<-chunksOf i -- define helper function 'c' that splits it's argument into
               -- chunks of site 'i'
         c m   -- split the matrix into chunks of size 'i'
      =<<      -- for each chunk
   transpose   --   transpose
 c.            --   and split into chunks of size 'i', again
               -- flatten one level of nesting ('=<<' is concatMap)

(m!n)i=        -- main function
    i#m\\i#n   -- remove every element of i#n from i#m
      ==[]     -- and check if it results in an empty list

C# (Visual C# Interactive Compiler), 178 bytes
(a,b,n)=>{string[]s(int[][]c){int i=0,l=a.Length,m=l/n;var r=new string[m*m];for(;i<l*l;)r[i/l/n*m+i%l/n]+=c[i/l][i++%l];Array.Sort(r);return r;}return s(a).SequenceEqual(s(b));}

Try it online!
-1 thanks to @KevinCruijssen!
-8 thanks to @ceilingcat!
Less golfed code:
// anonymous function
// a and b are 2d jagged arrays
// n is the size of the sub matrix
(a,b,n)=>{
  // helper function that translates
  // the sub matrices into strings
  // of digits.
  string[]s(int[][]c){
    // i and j are loop counters
    int i=0,j,
      // l is the size of a side of a matrix
      l=a.Length,
      // m is the number of sub matrices
      // per side of a matrix
      m=l/n;
    // the concatenated digits are
    // stored in a single dimension
    // array
    var r=new string[m*m];
    // flattened loop builds up
    // the digit strings
    for(;i<l*l;)
      r[i/l/n*m+i%l/n]+=c[i/l][i++%l];
    // The resulting array is
    // sorted before it is returned for
    // ease of comparison.
    Array.Sort(r);
    return r;
  }
  return s(a).SequenceEqual(s(b));
}

One minor thing to golf, the j++ can be removed and can be placed at +=c[i][j++]+" "; to save a byte.

Thanks for the tip :) Interestingly enough, I came up with almost the exact same solution as the Java one.

Red, 148 147 142 bytes
func[a b n][g: func[m][
sort collect[loop k:(length? m)/ n[i: 0
loop k[keep/only
collect[loop n[keep
take/part m/(i: i + 1) n]]]]]](g a)= g b]

Try it online!

PHP, 186 163 162 bytes
function($a,$b,$n){$f=function($j,$n){foreach($j as$x=>$r)foreach($r as$y=>$v)$o[count($j)*($x/$n|0)+$y/$n|0].=$v;sort($o);return$o;};return$f($a,$n)==$f($b,$n);}

Try it online!
Like all good challenges, I started off thinking this was fairly easy and it threw me some curves.  Nicely done @Kevin Cruijssen!
Chunks the matrix into strings containing the values for each block.  Arrays are then sorted and compared for equality.
Ungolfed:
function jigsaw_chunk( $j, $n ) {
    foreach( $j as $x => $r ) {
        foreach( $r as $y => $v ) {
            $o[ count( $j ) * floor( $x/$n ) + floor( $y/$n )] .= $v;
        }
    }
    sort( $o );
    return $o;
}

function jigsaw_test( $a, $b, $n ) {
    return jigsaw_chunk( $a, $n ) == jigsaw_chunk( $b, $n );
}

// Test 6
var_dump( jigsaw_test( [[1,2],[3,4]], [[2,3],[1,1]], 1 ) );

Output
bool(false)

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Chess move validation
Write a program that accepts chess moves, validate them and shows the results.
The program should:

Check wheter or not a move is valid
Check if a king is in check or in checkmate
Process the changes in position of the pieces
Not procees invalid moves
Use the format shown below, but format can be changed freely if you want

Input:

Full input:
white positions, black positions, starting, target position
[a1,b1,c1,d1,e1,f1,g1,h1,a0,b0,c0,d0,e0,f0,g0,h0],[a6,b6,c6,d6,e6,f6,g6,h6,a7,b7,c7,d7,e7,f7,g7,h7], a1, a2
Positions in the format a-h/0-7, eg. a0
Special position for beat pieces, for example XX
list ordered by starting position(Starting with peasants) contaning positions:
    [a1,b1,c1,d1,e1,f1,g1,h1,a0,b0,c0,d0,e0,f0,g0,h0]

Output:

Full output:
white positions, black positions, valid, check, checkmate
[a2,b1,c1,d1,e1,f1,g1,h1,a0,b0,c0,d0,e0,f0,g0,h0],[a6,b6,c6,d6,e6,f6,g6,h6,a7,b7,c7,d7,e7,f7,g7,h7], true, none, none
white and black positions is a list with the same format as the input
valid is boolean of wheter the move is valid or not
check is either none, white or black
checkmate is either none, white or black

Programming languages:
All programming languages are possible, but more "mainstream" languages are preferred.
Score:
The lowest working byte size wins, the win is awarded 10 days after the first valid answer.
Test Cases:
Input: [a1,b1,c1,d1,e1,f1,g1,h1,a0,b0,c0,d0,e0,f0,g0,h0],[a6,b6,c6,d6,e6,f6,g6,h6,a7,b7,c7,d7,e7,f7,g7,h7], a1, a2
Output: [a2,b1,c1,d1,e1,f1,g1,h1,a0,b0,c0,d0,e0,f0,g0,h0],[a6,b6,c6,d6,e6,f6,g6,h6,a7,b7,c7,d7,e7,f7,g7,h7], true, none, none

Input: [a5,b1,c1,d1,e1,f1,g1,h1,a0,b0,c0,d0,e0,f0,g0,h0],[a6,b6,c6,d6,e6,f6,g2,h6,a7,b7,c7,d7,e7,f7,g7,h7], a5, b6
Output: [b6,b1,c1,d1,e1,f1,g1,h1,a0,b0,c0,d0,e0,f0,g0,h0],[a6,xx,c6,d6,e6,f6,g2,h6,a7,b7,c7,d7,e7,f7,g7,h7], true, none, none

Input: [xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,d0,xx,xx,xx,h0],[xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,e7,xx,xx,xx], h0, h7
Output: [xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,d0,xx,xx,xx,h7],[xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,e7,xx,xx,xx], true, black, none

Input: [xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,d0,xx,xx,xx,h0],[xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,e7,xx,xx,xx], h0, h6
Output: [xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,d0,xx,xx,xx,h0],[xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,e7,xx,xx,xx], false, none, none

Input: [xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,d0,xx,xx,xx,h0],[xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,e7,xx,xx,xx], h0, h8
Output: [xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,d0,xx,xx,xx,h0],[xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,e7,xx,xx,xx], false, none, none

Input: [xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,f4,xx,xx,xx,a0],[xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,h4,xx,xx,xx], a0, h0
Output: [xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,d0,xx,xx,xx,h0],[xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,xx,e7,xx,xx,xx], true, none, black

Possible duplicate: Is it a valid chess move?

Welcome to PPCG! Nice first challenge. Don't let its closure discourage you from participating here but, for future challenges, you might consider using our Sandbox where dupes and other potential issues will often be caught before a challenge can be posted to Main.


text:
Work out \$x^y\$ using only addition and subtraction
The challenge is to implement a function or program that takes two numbers, \$x\$ and \$y\$ and return the result of \$x^y\$.
The program cannot use any other mathematical operation other than \$+\$ or \$-\$, so no multiplication or division. Functions built into languages are also not allowed.
The code in the least amount of bytes wins.

Hi, maybe this question belongs to https://puzzling.stackexchange.com/ or https://math.stackexchange.com/ rather than here

In general, we avoid challenges of the type "do x without y".

Are x and y guaranteed to be integers? What counts as "other mathematical operation"s ... does equality and inequality count? How about array or string multiplication that isn't a mathematical operator but creates copies of the array or string?

Duplicate of Calculate the a ^ b WITHOUT using *, / and ^ which itself is a duplicate of this which is a duplicate of this…

APL (Dyalog Unicode), 7 bytesSBCS
Anonymous tacit infix function. y is left argument and x is right argument.
(+/⍴)/⍴

Try it online!
⍴ cyclically reshape (gives y copies of x)
(…)/ reduce by the following function:
 ⍴ cyclically reshape to left argument copies of right argument
 +/ sum

I was groping toward this solution in a "traditional" mode; however, for some reason, I can never get APL to produce output on TIO - what might I be doing wrong? The test case I was trying with was +/4⍴+/3⍴3, to see if I was on the right track for 3^4.

@JeffZeitlin If you put code in TIO's Code field, you must use ⎕← to output.

Thanks. I don't know a facepalm emoticon/emoji, but consider it included here...

@JeffZeitlin

Python 2, 53 bytes
lambda x,y:y>1and sum(x for _ in range(f(x,y-1)))or x

Try it online!


text:
Equal, sum or difference!
Write shortest possible code that will return true if the two given integer values are equal or their sum or absolute difference is 5.
Example test cases:
4 1 => True
10 10 => True
1 3 => False
6 2 => False
1 6 => True
-256 -251 => True
6 1 => True
-5 5 => False

The shortest I could come up with in python2 is 56 characters long:
x=input();y=input();print all([x-y,x+y-5,abs(x-y)-5])<1

-9, thanks @ElPedro. It takes input in format x,y:
x,y=input();print all([x-y,x+y-5,abs(x-y)-5])<1

welcome to PPCG! This is a good first challenge -- the challenge is clearly defined, it has ample test cases, and uses our default I/O! If you stick around for a while and keep thinking up interesting challenges, I would recommend using The Sandbox to get feedback before posting them to this site. I hope you enjoy the time you spend here!

Python 2, 30 bytes
lambda a,b:a in(b,5-b,b-5,b+5)

Try it online!
One byte saved by Arnauld
Three bytes saved by alephalpha

This is amazingly concise, thanks

Same can be done in Octave/MATLAB in 29 bytes (Try it online!).

JavaScript (ES6), 28 bytes
Takes input as (a)(b). Returns \$0\$ or \$1\$.
a=>b=>a+b==5|!(a-=b)|a*a==25

Try it online!

Damn, took me a long long time to figure out how this handling the difference part. :)

Dyalog APL, 9 bytes
=∨5∊+,∘|-

Try it online!
Spelled out:
  =   ∨  5      ∊                +   , ∘    |            -
equal or 5 found in an array of sum and absolute of difference.

x86 machine code, 39 bytes
00000000: 6a01 5e6a 055f 5251 31c0 39d1 0f44 c601  j.^j._RQ1.9..D..
00000010: d139 cf0f 44c6 595a 29d1 83f9 050f 44c6  .9..D.YZ).....D.
00000020: 83f9 fb0f 44c6 c3                        ....D..

Assembly
section .text
	global func
func:					;inputs int32_t ecx and edx
	push 0x1
	pop esi
	push 0x5
	pop edi
	push edx
	push ecx
	xor eax, eax

	;ecx==edx?
	cmp ecx, edx
	cmove eax, esi

	;ecx+edx==5?
	add ecx, edx
	cmp edi, ecx
	cmove eax, esi

	;ecx-edx==5?
	pop ecx
	pop edx
	sub ecx, edx
	cmp ecx, 5

	;ecx-edx==-5?
	cmove eax, esi
	cmp ecx, -5
	cmove eax, esi

	ret

Try it online!
Edit: fixed bash stderr errors on TIO
Edit 2: improved formatting in TIO header and footer code

Jelly, 7 bytes
+,ạ5eo=

Try it online!
How it works
+,ạ5eo=  Main link. Arguments: x, y (integers)

+        Yield x+y.
  ạ      Yield |x-y|.
 ,       Pair; yield (x+y, |x-y|).
   5e    Test if 5 exists in the pair.
      =  Test x and y for equality.
     o   Logical OR.

Python 2, 29 31 bytes
lambda a,b:a+b==5or`a-b`in"0-5"

Try it online!
Since I didn't manage to read the task carefully the first time, in order to fix it, I had to come up with a completely different approach, which is unfortunately not as concise.

R, 40 bytes (or 34)
function(x,y)any((-1:1*5)%in%c(x+y,x-y))

Try it online!
For non-R users:

-1:1*5 expands to [-5, 0, 5]
the %in% operator takes elements from the left and checks (element-wise) if they exist in the vector on the right

A direct port of @ArBo's solution has 35 34 bytes, so go upvote that answer if you like it:
function(x,y)x%in%c(y--1:1*5,5-y)

The 34 byte one can be reduced by 1 with function(x,y)x%in%c(y--1:1*5,5-y)

Can drop to 30 bytes by moving the subtraction: function(x,y)(x-y)%in%(-1:1*5), and drop it further to 24 bytes by dropping the function notation to scan() input: diff(scan())%in%(-1:1*5) Try it online!.
Still very much the same method though.

@CriminallyVulgar does that account for the sum being 5?

@ArBo Hah, missed that in the spec, and there wasn't a test case in the TIO so I just glossed over it!

Minor change that can be made to both is to use pryr::f, which happens to work in both cases. Whether it can properly detect the arguments is entirely somewhat hit or miss but it seems to nail these two functions. e.g. pryr::f(x%in%c(y--1:1*5,5-y)) Try it online!.
Gets you to 36 and 29 bytes respectively.

This fails on (3, -3) - returns True because they sum to 0.

J, 12 11 bytes
1 byte saved thanks to Adám
1#.=+5=|@-,+

Try it online!
Explanation
This is equivalent to:
1 #. = + 5 = |@- , +

This can be divided into the following fork chain:
(= + (5 e. (|@- , +)))

Or, visualized using 5!:4<'f':
  ┌─ =
  ├─ +
──┤   ┌─ 5
  │   ├─ e.
  └───┤          ┌─ |
      │    ┌─ @ ─┴─ -
      └────┼─ ,
           └─ +

Annotated:
  ┌─ =                                     equality
  ├─ +                                     added to (boolean or)
──┤   ┌─ 5                                   noun 5
  │   ├─ e.                                  is an element of
  └───┤          ┌─ |  absolute value         |
      │    ┌─ @ ─┴─ -  (of) subtraction       |
      └────┼─ ,        paired with            |
           └─ +        addition               | any of these?

Save a byte with e.

@Adám How so? Shortest approach I got with e. was =+.5 e.|@-,+. Maybe you forget 5e. is an invalid token in J?

Since two integers cannot simultaneously sum to 5 and be equal, you can use + instead of +.

@Adám Ah, I see, thank you.

Python 2, 38 bytes
-2 bytes thanks to @DjMcMayhem
lambda a,b:a+b==5or abs(a-b)==5or a==b

Try it online!

Your TIO is actually 42 bytes but you can fix it by deleting the spaces between the 5s and the ors

Actually, the TIO link could be 38 bytes

@ElPedro the function itself was 40 bytes but I used f= in order to be able to call it

@DJMcMayhem I don't normally golf in python. I just did it because the question asker used python for their example

36 bytes

PowerShell, 48 44 40 bytes
param($a,$b)$b-in($a-5),(5-$a),(5+$a),$a

Try it online! or Verify all Test Cases
Takes input $a and $b. Checks if $b is -in the group ($a-5, 5-$a 5+$a, or $a), which checks all possible combinations of $a,$b, and 5.
-4 bytes thanks to mazzy.
-4 bytes thanks to KGlasier.

($a-$b) is -$x :)

@mazzy Ooo, good call.

If you switch 5 and $b around you can cut off a couple bytes(ie param($a,$b)$b-in($a-5),(5-$a),($a+5),$a) Try it out here

@KGlasier Excellent suggestion. I needed to swap $a+5 to 5+$a to get it to cast appropriately when taking command-line input, but otherwise awesome. Thanks!

Wolfram Language (Mathematica), 22 bytes
Takes input as [a][b].
MatchQ[#|5-#|#-5|#+5]&

Try it online!

Pascal (FPC), 26 70 bytes
Edit: + input variables.
Procedure z(a,b:integer);begin Writeln((abs(a-b)in[0,5])or(a+b=5))end;

Try it online!

(abs(a-b)in[0,5])or(a+b=5)

Try it online!
I hope that my answer is according to all rules of code-golf. It was fun anyway.

Hello, and welcome to PPCG! Normally, you have to take input, instead of assuming it is already in variables. I don't know Pascal, but I think that is what this code is doing.

Hello, NoOneIsHere and thank you for the remark. It was may concern too - shall I include the initialization of the variables. Looking at several other solutions, like Java for example, where the function definition with parameters was excluded from the total length of the solution, I decided not to include ReadLn.

Alright. Welcome to PPCG!

The Java submission is an anonymous lambda which takes two parameters. This appears to use predefined variables, which is not a valid method of input.

No problem, I will change my submission.

Java (JDK), 30 bytes
a->b->a+b==5|a==b|(b-=a)*b==25

Try it online!

Perl 6, 24 bytes
-1 byte thanks to Grimy
{$^a-$^b==5|0|-5|5-2*$b}

Try it online!
This uses the Any Junction but technically, ^ could work as well.
Explanation:
{                      }  # Anonymous code block
 $^a-$^b==                # Is the difference equal to
           | |  |        # Any of
          0
            5
              -5
                 5-2*$b

-1 byte with {$^a-$^b==5|0|-5|5-2*$b}

x86-16 machine code, 21 20 bytes
00000000: 8bd0 2bc3 740d 7902 f7d8 3c05 7405 03d3  ..+.t.y...<.t...
00000010: 80fa 05c3                                ....

Listing:
8B D0       MOV  DX, AX     ; Save AX to DX
2B C3       SUB  AX, BX     ; AX = AX - BX
74 0D       JZ   DONE       ; if 0, they are equal (ZF=1)
79 02       JNS  IS_POS     ; if positive, check if result is 5
F7 D8       NEG  AX         ; is negative, negate the result to get abs value
        IS_POS:
3C 05       CMP  AL, 5      ; is result 5?
74 05       JZ   DONE       ; if so, exit with ZF=1
03 D3       ADD  DX, BX     ; DX = DX + BX
80 FA 05    CMP  DL, 5      ; ZF = ( DX == 5 )
        DONE:
C3          RET             ; return to caller

Input numbers in AX and BX and returns Zero Flag (ZF) if result is truthy.
Try it online! (testing code borrowed and adapted from @Logem's answer - thanks!)
Explanation:
If the difference between the numbers is 0, they are equal. Otherwise if result is negative, first negate it (abs value) and check for 5.  If still not true, add and check for 5.
Bonus:
If desired, you can also determine which condition was true with the following:

ZF = 1 and DX = 5  ; sum is 5
ZF = 1 and AX = 5   ; diff is 5
ZF = 1 and AX = 0     ; equal
ZF = 0            ; falsey

C# (.NET Core), 43, 48, 47, 33 bytes
EDIT:  Tried to use % and apparently forgot how to %.  Thanks to Arnauld for pointing that out!
EDIT2:  AdmBorkBork with a -1 byte golf rearranging the parentheses to sit next to the return so no additional space is needed!
EDIT3:  Thanks to dana for -14 byte golf for the one-line return shortcut and currying the function (Ty Embodiment of Ignorance for linking to TIO).
C# (.NET Core), 33 bytes
a=>b=>a==b|a+b==5|(a-b)*(a-b)==25

Try it online!

Bah.  Trying to avoid System.Math.  Back to it!  Thanks for pointing that out :D

You can get it down to 33 bytes applying dana's tips

Scala, 43 bytes
def f(a:Int,b:Int)=a+b==5|(a-b).abs==5|a==b

Try it online!

Isn't it possible to golf the || to |? I know it's possible in Java, C#, Python, or JavaScript, but not sure about Scala.

Actually yes! thanks

05AB1E, 10 bytes
OIÆ‚Ä50SåZ

Try it online!

O           # Sum the input.
 IÆ         # Reduced subtraction of the input.
   ‚        # Wrap [sum,reduced_subtraction]
    Ä       # abs[sum,red_sub]
     50S    # [5,0]
        å   # [5,0] in abs[sum,red_sub]?
         Z  # Max of result, 0 is false, 1 is true.

Tried to do it using stack-only operations, but it was longer.

This will unfortunately return true if the sum is 0 such as for [5, -5]

Your other 10-byte solution that you left as a comment (OIÆÄ‚5QIËM) is correct for [5,-5].

Another 10-byte solution that I came up with is OsÆÄ‚5åsË~. Almost identical to yours it seems. Try it online!

C (gcc), 33 bytes
f(a,b){a=!(a+b-5&&(a-=b)/6|a%5);}

Try it online!
Tried an approach I didn't see anyone else try using. The return expression is equivalent to a+b==5||((-6<a-b||a-b<6)&&(a-b)%5==0).

Brachylog, 8 bytes
=|+5|-ȧ5

Takes input as a list of two numbers (use _ for negatives). Try it online!
Explanation
Pretty much a direct translation of the spec:
=          The two numbers are equal
 |         or
  +        The sum of the two numbers
   5       is 5
    |      or
     -     The difference of the two numbers
      ȧ    absolute value
       5   is 5

C (gcc), 41 34 bytes
f(a,b){a=5==abs(a-b)|a+b==5|a==b;}

Try it online!

Why does f return a? Just some Undefined Behavior?

@Tyilo Yes, it's implementation specific.  So happens the first parameter is stored in the same register as the return value.

30 bytes Try it online!

@Logern Doesn't work for f(6,1)

@ceilingcat Doesn't work for f(6,1)

33 bytes

@ceilingcat The logic is reversed. It returns false when it should return true.

05AB1E, 13 12 bytes
ÐO5Qs`α5QrËO

Try it online!
Takes input as a list of integers, saving one byte. Thanks @Wisław!
Alternate 12 byte answer
Q¹²α5Q¹²+5QO

Try it online!
This one takes input on separate lines.

Since it is not very clearly specified, can you not assume the input is a list of integers, thus eliminating the initial |?

@Wisław Good point, I updated my answer. Thanks!

I found a 11 bytes alternative: OI\αª5¢IË~Ā`. Input is a list of integers.

OIÆÄ)5QIËM is 10.

@MagicOctopusUrn I'm not sure exactly what the rules are but I think your solution is different enough from mine to submit your own answer, no? Also, unrelated but I've seen your username on this site for a long time but only after typing it out did I realize that it's "Urn", not "Um" :)

I already posted a different solution, but that's the one I got to while playing with yours so feel free to use it. Also I've always been annoyed at that rn=m with the SE font lol! Magic Octopus Urn is an anagram for my last_name+computing. Dennis chose it for me out of a list of anagrams.

Should've gone with Mr Contagious Cup, Magic Coupon Rust, or Narcotic Gum Soup

Ruby, 34 Bytes
->(a,b){[a+5,a-5,5-a,a].include?b}

Online Eval
-  Thanks @ASCII-Only

do you check if they're equal though...

Oops, forgot to add that check. Thanks @ASCII-only for pointing out the mistake.

i'd be nice if you could link to this

this might be valid? not completely sure though, you might wanna check with someone else

This will work but it requires .nil? check to give output in the required format.
->(a,b){[a+5,a-5,5-a,a].index(b).nil?}, this is longer than the current one.

Oh yeah, the question says "return true"

Factor, 44 40 bytes
Saved 4 bytes thanks to @chunes!
[ { [ = ] [ - abs 5 = ] [ + 5 = ] } || ]

Try it online!
The repetition of = is annoying, but I couldn't find another way.
|| tries out each of the three quotations in {...} and checks if the result is true for any of them. The first, [ = ], checks if they're equal, the second finds the absolute value of their difference and compares that to 5, and the third compares their sum to 5.

You can save 4 bytes with ||. Try it online!

@chunes Nice, thanks!

Japt, 14 13 bytes
¥VªaU ¥5ª5¥Nx

Try it online!

Tcl, 53 bytes
proc P a\ b {expr abs($a-$b)==5|$a==$b|abs($a+$b)==5}

Try it online!

Japt, 13 12 bytes
x ¥5|50ìøUra

Try it or run all test cases
x ¥5|50ìøUra
                 :Implicit input of array U
x                :Reduce by addition
  ¥5             :Equal to 5?
    |            :Bitwise OR
     50ì         :Split 50 to an array of digits
        ø        :Contains?
         Ur      :  Reduce U
           a     :    By absolute difference

Fails for [-5,5] (should be falsey)

Thanks, @KevinCruijssen. Rolled back to the previous version.

Batch, 81 bytes
@set/as=%1+%2,d=%1-%2
@if %d% neq 0 if %d:-=% neq 5 if %s% neq 5 exit/b
@echo 1

Takes input as command-line arguments and outputs 1 on success, nothing on failure. Batch can't easily do disjunctions so I use De Morgan's laws to turn it into a conjunction.

Charcoal, 18 bytes
Ｎθ¿№⟦θ⁺⁵θ⁻⁵θ⁻θ⁵⟧Ｎ1

Try it online! Link is to verbose version of code. Port of @ArBo's Python 2 solution.

Retina 0.8.2, 82 bytes
\d+
$*
^(-?1*) \1$|^(-?1*)1{5} -?\2$|^-?(-?1*) (\3)1{5}$|^-?(1 ?){5}$|^(1 ?-?){5}$

Try it online! Link includes test cases. Explanation: The first two lines convert the inputs into unary. The final line then checks for any of the permitted matches:
^(-?1*) \1$                              x==y
^(-?1*)1{5} -?\2$   x>=0 y>=0 x=5+y i.e. x-y=5
                    x>=0 y<=0 x=5-y i.e. x+y=5
                    x<=0 y<=0 x=y-5 i.e. y-x=5
^-?(-?1*) (\3)1{5}$ x<=0 y<=0 y=x-5 i.e. x-y=5
                    x<=0 y>=0 y=5-x i.e. x+y=5
                    x>=0 y>=0 y=5+x i.e. y-x=5
^-?(1 ?){5}$        x>=0 y>=0 y=5-x i.e. x+y=5
                    x<=0 y>=0 y=5+x i.e. y-x=5
^(1 ?-?){5}$        x>=0 y>=0 x=5-y i.e. x+y=5
                    x>=0 y<=0 x=5+y i.e. x-y=5

Pivoted by the last column we get:
x==y            ^(-?1*) \1$
x+y=5 x>=0 y>=0 ^-?(1 ?){5}$
      x>=0 y>=0 ^(1 ?-?){5}$
      x>=0 y<=0 ^(-?1*)1{5} -?\2$
      x<=0 y>=0 ^-?(-?1*) (\3)1{5}$
      x<=0 y<=0 (impossible)
x-y=5 x>=0 y>=0 ^(-?1*)1{5} -?\2$
      x>=0 y<=0 ^(1 ?-?){5}$
      x<=0 y>=0 (impossible)
      x<=0 y<=0 ^-?(-?1*) (\3)1{5}$
y-x=5 x>=0 y>=0 ^-?(-?1*) (\3)1{5}$
      x>=0 y<=0 (impossible)
      x<=0 y>=0 ^-?(1 ?){5}$
      x<=0 y<=0 ^(-?1*)1{5} -?\2$

Common Lisp, 48 bytes
(lambda(a b)(find 5(list(abs(- b a))a(+ a b)b)))

Desmos, 90 bytes
A pretty straightfoward solution, could definitely by golfed further:
f(a,b)=\left\{a+b=5:0,1\right\}\left\{\left|a-b\right|=5:0,1\right\}\left\{a=b:0,1\right\}

Try It On Desmos!

0 is true, and 1 is false.

Pyth, 12 bytes
}5[sQaFQ+4l{

Try it online!
}5[sQaFQ+4l{
}5[sQaFQ+4l{Q) // Implicit input and closed brace
  [          ) // Create an array of the following:
   sQ          //   Sum of input
     aFQ       //   Absolute difference of input
        +4l{Q  //   Length of unique values in input, + 4
}5             // Is '5' in the array?

Vyxal, 11 10 bytes
=£₌+ĸW5c¥∨

Try it Online!
Credits

Saved 1 byte thanks to @Lyxal by employing the use of an absolute difference built-in

10 bytes ;p

Pyth, 15 bytes
|!!/,a.*QsQ5q.*

Try it online!
Not super impressed, especially having to use double negation !! to cast a number into true... I'm sure there's a better way.
|!!/,a.*QsQ5q.*
   /,      5     Count '5's in:
     a.*Q        Absolute value of (A, B)
         sQ      Sum of (A, B)
 !!              Cast to truthy
|                OR:
            q.*  A==B

Doh, I already solved this one several months ago and did it in 12 chars... https://codegolf.stackexchange.com/a/215521/97730

Factor, 37 bytes
[ 2dup + 5 = -rot - abs "\0"in? or ]

Try it online!
Explanation
"\0" Has literal 0 and 5 embedded in the string (you can see it on TIO). So "\0"in? is equivalent to { 0 5 } member? In other words, checking whether the input is 0 or 5.
          ! -256 -251
2dup      ! -256 -251 -256 -251
+         ! -256 -251 -507
5         ! -256 -251 -507 5
=         ! -256 -251 f
-rot      ! f -256 -251
-         ! f -5
abs       ! f 5
"\0"in?   ! f t
or        ! t

*><>, 33 bytes
:{:}=?;:{:}+5=?;-:0(?!u01-*O5=?;.

Try it online!
Could be lower if handling negative numbers wasn't a requirement. Uses the exit code as its truthy/falsey.
Initializes the stack with the -i flag, but this method can't handle negatives. The above code still works, but you must prepend your starting values to the start of the script. For example, the following works with the stack of [-15, 12]
53*0-c:{:}=?;:{:}+5=?;-:0(?!u01-*O5=?;.

Explanation
:{:}                                Duplicate the two values on the stack
    =?;                             If they're equal, halt execution
       :{:}                         Duplicate the two values on the stack, again
           +                        Add them together
            5=                      Check if that value is equal to 5
              ?;                    If so, halt execution
                -:                  Else, subtract our two values, and duplicate the result
                  0(                Check if the difference is less than 0
                    ?!u             If it is greater than 0, Dive and ignore instructions until we reach a Rise
                       01-*         If it isn't, multiply it by -1
                            O       Rise from our previous Dive. Ignored if there was no Dive.
                             5=     Check if our difference is equal to 5
                               ?;   If so, halt execution
                                 .  Else, throw an error

Runic Enchantments, 27 bytes
i::i::}3s=?!@-'|A5:}=?!@+=@

Try it online!
Outputs 0 (exactly one zero) for false and any other output (literally whatever is left on the stack) for true.
New interpreter build, updated answer, saved 3 bytes (previous revision miscounted and said 4).
Explanation:
i::i::                         Read two inputs, duplicating each twice.
      }                        Rotate stack right
       3s                      Rotate the top 3 items to the right
         =? @                  Compare equal, if so, dump stack
           !                   If not, skip next instruction
             -'|A              Subtract, absolute value, (j)
                 5:}           Push two 5s, rotate one to the bottom
                    =? @       Compare 5 with (j), if equal, dump stack
                      ! +=     If not, add the two inputs, compare with remaining 5
                          @    Dump stack (will be 1 for true and 0 for false)

Essentially it reads both inputs 3 times and arranges the stack so that each operation works on a copy of each input (or a literal 5). As the only way to dump a 0 is if all three comparisons are false, simply dumping the rest of the stack avoids having to do anything other than vomiting the entire stack to output and terminating, all posibilities of which are valid truthy values.

Perl 5, 51 bytes
Pretty simple really, uses the an flags for input. Outputs 0 for false, 1 for true. Not gonna lie, I don't know if bitwise OR is appropriate here, but is does work for all the test cases, so that's nice.
($a,$b)=@F;print($a==$b|$a+$b==5|$a-$b==5|$b-$a==5)

Try it online!

bitwise OR is equivalent to logical OR when operating on one-bit values. In general, if passed a truthy arguments bitwise OR will return truthy, and if passed two falsy arguments bitwise OR will return 0.

-11 bytes

38 bytes

APL(NARS) 19 chars, 38 bytes
{∨/(⍺=⍵),5∊∣⍺+⍵,-⍵}

  f←{∨/(⍺=⍵),5∊∣⍺+⍵,-⍵}
  4 f 1
1
  1 f 3
0
  6 f 2
0
  1 f 6
1
  ¯256 f ¯251
1
  6 f 1
1
  ¯5 f 5
0

Ruby (>=1.9), 23 38 bytes
->(a,b){a==b or a+b==5 or(a-b).abs==5}

Try it online!
It's an anonymous function, so the TIO has some extra code to take input and return the output. Put the two numbers on separate lines.
Returns true if they are equal or add to 5, or if their absolute difference is 5, and false if not.

:| it's longer than the other (older) one

also. better link

Julia 1.0, 38 bytes
f(a,b)=((a+b-5)*(a-b)*(abs(a-b)-5))==0

Try it online!
Of course, it's probably not the shortest one

Haskell, 30 Bytes
a?b=elem 5[a-b+5,abs(a-b),a+b]

Vyxal, 8 bytes
₍+ε5c□≈∨

Try it Online!


text:
Dig a border trench
Background: Too many illegal immigrants from Blandia are crossing the border to Astan. The emperor of Astan has tasked you with digging a trench to keep them out, and Blandia must pay for the expenses. Since all typists have been furloughed until the trench is arranged, your code must be as short as possible.*
Task: Given a 2D map of the border between Astan and Blandia, make the Blands pay (with land) for a border trench.
For example: With Astanian cells marked A, Blandic cells marked B and trench cells marked + (the map frames are only for clarity):
┌──────────┐ ┌──────────┐
│AAAAAAAAAA│ │AAAAAAAAAA│
│ABAAAAAABA│ │A+AAAAAA+A│
│ABBBAABABA│ │A+++AA+A+A│
│ABBBAABABA│ │A+B+AA+A+A│
│ABBBBABABA│→│A+B++A+A+A│
│ABBBBABBBB│ │A+BB+A++++│
│ABBBBABBBB│ │A+BB+A+BBB│
│ABBBBBBBBB│ │A+BB+++BBB│
│BBBBBBBBBB│ │++BBBBBBBB│
└──────────┘ └──────────┘

Details: The map will have at least three rows and three columns. The top row will be entirely Astanian and the bottom row will be entirely Blandic.
 You may use any three values to represent Astanian territory, Blandic territory, and border trench, as long as input and output are consistent.
Automaton formulation: A Blandic cell with at least one Astanian cell in its Moore neighbourhood becomes a border trench cell.
Test cases
[
  "AAAAAAAAAA",
  "ABAAAAAABA",
  "ABBBAABABA",
  "ABBBAABABA",
  "ABBBBABABA",
  "ABBBBABBBB",
  "ABBBBABBBB",
  "ABBBBBBBBB",
  "BBBBBBBBBB"
]

becomes:
[
  "AAAAAAAAAA",
  "A+AAAAAA+A",
  "A+++AA+A+A",
  "A+B+AA+A+A",
  "A+B++A+A+A",
  "A+BB+A++++",
  "A+BB+A+BBB",
  "A+BB+++BBB",
  "++BBBBBBBB"
]

[
  "AAA",
  "AAA",
  "BBB"
]

becomes:
[
  "AAA",
  "AAA",
  "+++"
]

[
  "AAAAAAAAAA",
  "AAAABBBAAA",
  "AAAABBBAAA",
  "AAAABBBAAA",
  "AAAAAAAAAA",
  "BBBBBBABBB",
  "BBBBBBAABB",
  "BBBAAAAABB",
  "BBBBBBBBBB"
]

becomes:
[
  "AAAAAAAAAA",
  "AAAA+++AAA",
  "AAAA+B+AAA",
  "AAAA+++AAA",
  "AAAAAAAAAA",
  "++++++A+++",
  "BB++++AA+B",
  "BB+AAAAA+B",
  "BB+++++++B"
]

* DISCLAIMER: ANY RESEMBLANCE TO ACTUAL GEOPOLITICS IS PURELY COINCIDENTAL!

Political satire in the form of code golf, I love it :o)

-1 for that  :-P

Does the input/output have to be a list of strings or are other formats acceptable? my preference is single string with newline separators. Others may prefer 2D array of characters, etc.

@LevelRiverSt Anything that reasonably represents 2D is fine. A string with newlines is an obvious one.

python, 4 bytes: pass The plans to build a border trench lead to a government shutdown and nothing happens.

@TheEspinosa No no, the shutdown is until the trench is arranged.

I upvoted just because of the background story. Didn't even continue reading.

DISCLAIMER: ANY RESEMBLANCE TO ACTUAL GEOPOLITICS IS PURELY COINCIDENTAL!

Wolfram Language (Mathematica), 15 bytes
2#-#~Erosion~1&

Try it online!
Or (39 bytes):
MorphologicalPerimeter[#,Padding->1]+#&

Try it online!
What else would we expect from Mathematica? Characters used are {Astan -> 0, Blandia -> 1, Trench -> 2}.

MATL, 11 8 bytes
Inspired by @flawr's Octave answer and @lirtosiast's Mathematica answer.
EG9&3ZI-

The input is a matrix with Astan represented by 0 and Blandia by 1. Trench is represented in the output by 2.
Try it online!
How it works
E       % Implicit input. Multiply by 2, element-wise
G       % Push input again
9       % Push 9
&3ZI    % Erode with neighbourhood of 9 elements (that is, 3×3)
-       % Subtract, element-wise. Implicit display

JavaScript (ES7),  84  82 bytes
Saved 2 bytes thanks to @Shaggy
Takes input as a matrix of integers, with \$3\$ for Astan and \$0\$ for Blandia. Returns a matrix with the additional value \$1\$ for the trench.
a=>(g=x=>a.map(t=(r,Y)=>r.map((v,X)=>1/x?t|=(x-X)**2+(y-Y)**2<v:v||g(X,y=Y)|t)))()

Try it online!
Commented
a => (                      // a[] = input matrix
  g = x =>                  // g = function taking x (initially undefined)
    a.map(t =               //   initialize t to a non-numeric value
      (r, Y) =>             //   for each row r[] at position Y in a[]:
      r.map((v, X) =>       //     for each value v at position X in r[]:
        1 / x ?             //       if x is defined (this is a recursive call):
          t |=              //         set the flag t if:
            (x - X) ** 2 +  //           the squared Euclidean distance
            (y - Y) ** 2    //           between (x, y) and (X, Y)
            < v             //           is less than v (3 = Astan, 0 = Blandia)
        :                   //       else (this is the initial call to g):
          v ||              //         yield v unchanged if it's equal to 3 (Astan)
          g(X, y = Y)       //         otherwise, do a recursive call with (X, Y) = (x, y)
          | t               //         and yield the flag t (0 = no change, 1 = trench)
      )                     //     end of inner map()
    )                       //   end of outer map()
)()                         // initial call to g

82 bytes?

@Shaggy Not enough questions lately. I don't know how to golf anymore. :D Thanks!

I was only thinking the same thing earlier!

K (ngn/k), 24 bytes
{x+x&2{++/'3':0,x,0}/~x}

Try it online!
uses 0 1 2 for "AB+"
{ } function with argument x
~ logical not
2{ }/ twice do

0,x,0 surround with 0-s (top and bottom of the matrix)

3': triples of consecutive rows

+/' sum each

+ transpose

x& logical and of x with
x+ add x to

PowerShell, 220 bytes
It's not as small as the other submissions, but I thought I'd add it for reference.
[FORE!]
function m($i,$m){($i-1)..($i+1)|?{$_-in0..$m}}
$h=$a.count-1;$w=$a[0].length-1
foreach($i in 0..$h){-join$(foreach($j in 0..$w){if ($a[$i][$j]-eq'B'-and($a[(m $i $h)]|?{$_[(m $j $w)]-match'A'})){'+'}else{$a[$i][$j]}})}

Try it online!

Welcome to PPCG. Nice first answer, with TIO link even! Don't worry about code length; each language competes against itself. Btw, you can save one byte by removing the first line break with no ill effects.

Can the final line become 0..$h|%{-join$(foreach($j in 0..$w){if ($a[$_][$j]-eq'B'-and($a[(m $_ $h)]|?{$_[(m $j $w)]-match'A'})){'+'}else{$a[$_][$j]}})} for 207 bytes?

APL (Dyalog Unicode), 11 bytesSBCS
⊢⌈{2∊⍵}⌺3 3

this is based on @dzaima's 12-byte solution in chat. credit to @Adám himself for thinking of using ∊ in the dfn, and to @H.PWiz for reminding us to use the same encoding for input and output
Try it online!
represents 'AB+' as 2 0 1 respectively
{ }⌺3 3 apply a function to each overlapping 3×3 region of the input, including regions extending 1 unit outside the matrix, padded with 0s
2∊⍵ is a 2 present in the argument? return a 0/1 boolean
⊢⌈ per-element max of that and the original matrix

Of course, switching to Stencil would save you more than half of your bytes.

@Adám that would be an answer in a different language, so not comparable or competing against this answer. and i don't find golfing in special-purpose languages particularly interesting, sorry

@Adám an alias for display which i forgot to remove. removed now

Octave, 37 31 26 bytes
This function performs a morphological erosion on the Astan (1-b) part of the "image" using conv2 imerode, and then uses some arithmetic to make all three areas different symbols. Thanks @LuisMendo for -5 bytes!
@(b)2*b-imerode(b,ones(3))

Try it online!

@LuisMendo An earlier version did include a convolution:)

J, 28 bytes
>.3 3(2 e.,);._3(0|:@,|.)^:4

Try it online!
'AB+' -> 2 0 1
Inspired by ngn's APL solution. 12 bytes just to pad the matrix with zeroes...

why is the APL solution able to get away without doing the zero padding?

@Jonah: APL's ⌺ (Stencil) does it atomatically: "Rectangles are centred on successive elements of Y and (unless the rectangle size is 1), padded with fill elements."

that seems so much more useful than J’s version...

@Jonah Yes, it is!

Charcoal, 20 bytes
≔⪫θ⸿θＰθＦθ⎇∧№ＫＭA⁼Bι+ι

Try it online! Link is to verbose version of code. Explanation:
≔⪫θ⸿θ

Join the input array with carriage returns rather than the usual newlines. This is needed so that the characters can be printed individually.
Ｐθ

Print the input string without moving the cursor.
Ｆθ

Loop over each character of the input string.
⎇∧№ＫＭA⁼Bι

If the Moore neighbourhood contains an A, and the current character is a B...
+

... then overwrite the B with a +...
ι

... otherwise print the current character (or move to the next line if the current character is a carriage return).

JavaScript, 85 bytes
Threw this together late last night and forgot about it. Probably still room for some improvement somewhere.
Input and output is as an array of digit arrays, using 3 for Astan, 0 for Blandia & 1 for the trench.
a=>a.map((x,i)=>x.map((y,j)=>o.map(v=>o.map(h=>y|=1&(a[i+v]||x)[j+h]))|y),o=[-1,0,1])

Try it online (For convenience, maps from & back to the I/O format used in the challenge)

Javascript, 126 118 bytes
_=>_.map(x=>x.replace(/(?<=A)B|B(?=A)/g,0)).map((x,i,a)=>[...x].map((v,j)=>v>'A'&&(a[i-1][j]<v|(a[i+1]||x)[j]<v)?0:v))

Pass in one of the string arrays from the question, and you'll get an array of strings character arrays (thanks @Shaggy!) out using 0 for the trench. Can probably be golfed more (without switching over to numerical arrays), but I can't think of anything at the moment.

I think this works for 120 bytes.

Or 116 bytes returning an array of character arrays.

@Shaggy Your golf doesn't work, sadly - it doesn't catch places where A's and B's are diagonal to each-other. On the other hand, it does point out some really simple golfs that I missed...

PowerShell, 86 80 bytes
$p="(.?.?.{$(($args|% i*f '
')-1)})?"
$args-replace"(?s)(?<=A$p)B|B(?=$p`A)",'+'

Try it online!
The map is a string with newlines. This script replaces B to + with regexp (?<=A(.?.?.{$MapWidth-1})?)B|B(?=(.?.?.{$MapWidth-1})?A).
Less golfed Test script:
$f = {
$l=($args|% indexOf "`n")-1
$p="(.?.?.{$l})?"
$args-replace"(?s)(?<=A$p)B|B(?=$p`A)",'+'
}

@(
,(@"
AAAAAAAAAA
ABAAAAAABA
ABBBAABABA
ABBBAABABA
ABBBBABABA
ABBBBABBBB
ABBBBABBBB
ABBBBBBBBB
BBBBBBBBBB
"@,@"
AAAAAAAAAA
A+AAAAAA+A
A+++AA+A+A
A+B+AA+A+A
A+B++A+A+A
A+BB+A++++
A+BB+A+BBB
A+BB+++BBB
++BBBBBBBB
"@)
,(@"
AAA
AAA
BBB
"@,@"
AAA
AAA
+++
"@)
,(@"
AAAAAAAAAA
AAAABBBAAA
AAAABBBAAA
AAAABBBAAA
AAAAAAAAAA
BBBBBBABBB
BBBBBBAABB
BBBAAAAABB
BBBBBBBBBB
"@,@"
AAAAAAAAAA
AAAA+++AAA
AAAA+B+AAA
AAAA+++AAA
AAAAAAAAAA
++++++A+++
BB++++AA+B
BB+AAAAA+B
BB+++++++B
"@)
) | % {
    $map,$expected = $_
    $result = &$f $map
    $result-eq$expected
    #$result # uncomment this line to display results
}

Output:
True
True
True

Retina 0.8.2, 92 80 bytes
(?<=¶(.)*)B(?=.*¶(?<-1>.)*(?(1)_)A|(?<=¶(?(1)_)(?<-1>.)*A.*¶.*))
a
iT`Ba`+`.?a.?

Try it online! Loosely based on my answer to Will I make it out in time? Explanation: Any Bs immediately above or below As are turned into as. This then reduces the problem to checking Bs to the left or right of As or as. The as themselves also need to get turned into +s of course, but fortunately the i flag to T only affects the regex match, not the actual transliteration, so the As remain unaffected.

C# (Visual C# Interactive Compiler), 187 bytes
a=>a.Select((b,i)=>b.Select((c,j)=>{int k=0;for(int x=Math.Max(0,i-1);x<Math.Min(i+2,a.Count);x++)for(int y=Math.Max(0,j-1);y<Math.Min(j+2,a[0].Count);)k+=a[x][y++];return k>1&c<1?9:c;}))

Instead of chaining Take()s, Skip()s, and Select()s, instead this uses double for loops to find neighbors. HUGE  byte decrease, from 392 bytes to 187. Linq isn't always the shortest!
Try it online!

Java 8, 169 145 bytes
m->{for(int i=m.length,j,k;i-->0;)for(j=m[i].length;j-->0;)for(k=9;m[i][j]==1&k-->0;)try{m[i][j]=m[i+k/3-1][j+k%3-1]<1?2:1;}catch(Exception e){}}

-24 bytes thanks to @OlivierGrégoire.
Uses 0 instead of A and 1 instead of B, with the input being a 2D integer-matrix. Modifies the input-matrix instead of returning a new one to save bytes.
The cells are checked the same as in my answer for the All the single eights challenge.
Try it online.
Explanation:
m->{                            // Method with integer-matrix parameter and no return-type
  for(int i=m.length,j,k;i-->0;)//  Loop over the rows
    for(j=m[i].length;j-->0;)   //   Inner loop over the columns
      for(k=9;m[i][j]==1&       //    If the current cell contains a 1:
          k-->0;)               //     Inner loop `k` in the range (9, 0]:
        try{m[i][j]=            //      Set the current cell to:
             m[i+k/3-1]         //       If `k` is 0, 1, or 2: Look at the previous row
                                //       Else-if `k` is 6, 7, or 8: Look at the next row
                                //       Else (`k` is 3, 4, or 5): Look at the current row
              [j+k%3-1]         //       If `k` is 0, 3, or 6: Look at the previous column
                                //       Else-if `k` is 2, 5, or 8: Look at the next column
                                //       Else (`k` is 1, 4, or 7): Look at the current column
               <1?              //       And if this cell contains a 0:
                  2             //        Change the current cell from a 1 to a 2
                 :              //       Else:
                  1;            //        Leave it a 1
        }catch(Exception e){}}  //      Catch and ignore ArrayIndexOutOfBoundsExceptions
                                //      (try-catch saves bytes in comparison to if-checks)

I haven't checked much, but is there anything wrong with m[i+k/3-1][j+k%3-1]? 145 bytes

@OlivierGrégoire Dang, that's so much easier.. Thanks!

I think it's also valid for your answers of previous challenges given that they seem to have the same structure

@OlivierGrégoire Yeah, I was about to golf those as well with your suggestion, but then another comment (and a question at work) came in between. Will do so in a moment.

Perl 5, 58 46 bytes
$m=($n=/$/m+"@+")-2;s/A(|.{$m,$n})\KB|B(?=(?1)A)/+/s&&redo

TIO
-12 bytes thanks to @Grimy
/.
/;s/A(|.{@{-}}.?.?)\KB|B(?=(?1)A)/+/s&&redo

TIO

-p like -n but print also
-00 paragraph mode
to get the width-1 /.\n/ matches the last character of first line
@{-} special array the position of start of match of previous matched groups, coerced as string (first element)
s/../+/s&&redo replace match by + while matches

/s flag, so that . matches also newline character

A(|.{@{-}}.?.?)\KB matches

AB or A followed by (width-1) to (width+1) characters folowed by B
\K to keep the left of B unchanged

B(?=(?1)A),

(?1) dirverting recursive, to reference previous expression (|.{$m,$o})
(?=..) lookahead, to match without consuming input

-9 bytes with /. /,@m=@-while s/A(|.{@m}.?.?)\KB|B(?=(?1)A)/+/s (literal newline in the first regex). TIO

Down to 46: /. /;s/A(|.{@{-}}.?.?)\KB|B(?=(?1)A)/+/s&&redo. TIO

thanks, i also had the idea, but discarded because was thinking to catastrophic backtracking however for code golf performance is not important

05AB1E, 29 bytes
_2FIн¸.øVgN+FYN._3£})εøO}ø}*Ā+

Matrices aren't really 05AB1E's strong suit (nor are they my strong suit).. Can definitely be golfed some more, though.
Inspired by @ngn's K (ngn/k) answer, so also uses I/O of a 2D integer matrix with 012 for AB+ respectively.
Try it online. (The footer in the TIO is to pretty-print the output. Feel free to remove it to see the matrix output.)
Explanation:
_                # Inverse the values of the (implicit) input-matrix (0→1 and 1→0)
                 #  i.e. [[0,0,0,0],[0,1,0,0],[0,1,1,1],[1,1,1,1]]
                 #   → [[1,1,1,1],[1,0,1,1],[1,0,0,0],[0,0,0,0]]
 2F              # Loop `n` 2 times in the range [0, 2):
   Iн            #  Take the input-matrix, and only leave the first inner list of 0s
                 #   i.e. [[0,0,0,0],[0,1,0,0],[0,1,1,1],[1,1,1,1]] → [0,0,0,0]
     ¸           #  Wrap it into a list
                 #   i.e. [0,0,0,0] → [[0,0,0,0]]
      .ø         #  Surround the inverted input with the list of 0s
                 #   i.e. [[1,1,1,1],[1,0,1,1],[1,0,0,0],[0,0,0,0]] and [0,0,0,0]
                 #    → [[0,0,0,0],[1,1,1,1],[1,0,1,1],[1,0,0,0],[0,0,0,0],[0,0,0,0]]
        V        #  Pop and store it in variable `Y`
   g             #  Take the length of the (implicit) input-matrix
                 #   i.e. [[0,0,0,0],[0,1,0,0],[0,1,1,1],[1,1,1,1]] → 4
    N+           #  Add `n` to it
                 #   i.e. 4 and n=0 → 4
                 #   i.e. 4 and n=1 → 5
      F          #  Inner loop `N` in the range [0, length+`n`):
       Y         #   Push matrix `Y`
        N._      #   Rotate it `N` times towards the left
                 #    i.e. [[0,0,0,0],[1,1,1,1],[1,0,1,1],[1,0,0,0],[0,0,0,0],[0,0,0,0]] and N=2
                 #     → [[1,0,1,1],[1,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,1,1,1]]
            3£   #   And only leave the first three inner lists
                 #    i.e. [[1,0,1,1],[1,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,1,1,1]]
                 #     → [[1,0,1,1],[1,0,0,0],[0,0,0,0]]
              }  #  After the inner loop:
    )            #  Wrap everything on the stack into a list
                 #   → [[[0,0,0,0],[1,1,1,1],[1,0,1,1]],[[1,1,1,1],[1,0,1,1],[1,0,0,0]],[[1,0,1,1],[1,0,0,0],[0,0,0,0]],[[1,0,0,0],[0,0,0,0],[0,0,0,0]]]
     €ø          #  Zip/transpose (swapping rows/columns) each matrix in the list
                 #   → [[[0,1,1],[0,1,0],[0,1,1],[0,1,1]],[[1,1,1],[1,0,0],[1,1,0],[1,1,0]],[[1,1,0],[0,0,0],[1,0,0],[1,0,0]],[[1,0,0],[0,0,0],[0,0,0],[0,0,0]]]
       O         #  And take the sum of each inner list
                 #   → [[2,1,2,2],[3,1,2,2],[2,0,1,1],[1,0,0,0]]
        ø        #  Zip/transpose; swapping rows/columns the entire matrix again
                 #   i.e. [[2,1,2,2],[3,1,2,2],[2,0,1,1],[1,0,0,0]]
                 #    → [[2,3,2,1],[1,1,0,0],[2,2,1,0],[2,2,1,0]]
               } # After the outer loop:
                 #   i.e. [[3,5,5,4,2],[4,6,5,4,2],[2,3,2,2,1],[1,1,0,0,0]]
  *              # Multiple each value with the input-matrix at the same positions,
                 # which implicitly removes the trailing values
                 #  i.e. [[3,5,5,4,2],[4,6,5,4,2],[2,3,2,2,1],[1,1,0,0,0]]
                 #   and [[0,0,0,0],[0,1,0,0],[0,1,1,1],[1,1,1,1]]
                 #    → [[0,0,0,0],[0,1,0,0],[0,2,1,0],[2,2,1,0]]
   Ā             # Truthify each value (0 remains 0; everything else becomes 1)
                 #  i.e. [[0,0,0,0],[0,1,0,0],[0,2,1,0],[2,2,1,0]]
                 #   → [[0,0,0,0],[0,1,0,0],[0,1,1,1],[1,1,0,0]]
    +            # Then add each value with the input-matrix at the same positions
                 #  i.e. [[0,0,0,0],[0,1,0,0],[0,1,1,1],[1,1,0,0]]
                 #   and [[0,0,0,0],[0,1,0,0],[0,1,1,1],[1,1,1,1]]
                 #    → [[0,0,0,0],[0,2,0,0],[0,2,2,2],[2,2,1,1]]
                 # (and output the result implicitly)

Ruby, 102 bytes
->a{a+=?.*s=a.size
(s*9).times{|i|a[j=i/9]>?A&&a[j-1+i%3+~a.index($/)*(i/3%3-1)]==?A&&a[j]=?+}
a[0,s]}

Try it online!
input/output as a newline separated string

Python 2, 123 119 bytes
lambda m:[[[c,'+'][c=='B'and'A'in`[x[j-(j>0):j+2]for x in m[i-(i>0):i+2]]`]for j,c in e(l)]for i,l in e(m)];e=enumerate

Try it online!
I/O is a list of lists

TSQL, 252 bytes
Splitting the string is very costly, if the string was split and already in a table the byte count would be 127 characters. Script included in the bottom and completely different. Sorry for taking up this much space.
Golfed:
WITH C as(SELECT x,x/z r,x%z c,substring(@,x+1,1)v
FROM spt_values CROSS APPLY(SELECT number x,charindex(char(10),@)z)z
WHERE'P'=type)SELECT @=stuff(@,x+1,1,'+')FROM c WHERE
exists(SELECT*FROM c d WHERE abs(r-c.r)<2and
abs(c-c.c)<2and'AB'=v+c.v)PRINT @

Ungolfed:
DECLARE @ varchar(max)=
'AAAAAAAAAA
ABAAAAAABA
ABBBAABABA
ABBBAABABA
ABBBBABABA
ABBBBABBBB
ABBBBABBBB
ABBBBBBBBB
BBBBBBBBBB';

WITH C as
(
  SELECT x,x/z r,x%z c,substring(@,x+1,1)v
  FROM spt_values
  CROSS APPLY(SELECT number x,charindex(char(10),@)z)z
  WHERE'P'=type
)
SELECT
  @=stuff(@,x+1,1,'+')
FROM c
WHERE exists(SELECT*FROM c d
         WHERE abs(r-c.r)<2
           and abs(c-c.c)<2 and'AB'=v+c.v)
PRINT @

Try it out
TSQL, 127 bytes(Using table variable as input)
Execute this script in management studio - use "query"-"result to text" to make it readable
--populate table variable
USE master
DECLARE @v varchar(max)=
'AAAAAAAAAA
ABAAAAAABA
ABBBAABABA
ABBBAABABA
ABBBBABABA
ABBBBABBBB
ABBBBABBBB
ABBBBBBBBB
BBBBBBBBBB'

DECLARE @ table(x int, r int, c int, v char)

INSERT @
SELECT x+1,x/z,x%z,substring(@v,x+1,1)
FROM spt_values
CROSS APPLY(SELECT number x,charindex(char(10),@v)z)z
WHERE'P'=type and len(@v)>number

-- query(127 characters)

SELECT string_agg(v,'')FROM(SELECT
iif(exists(SELECT*FROM @
WHERE abs(r-c.r)<2and abs(c-c.c)<2and'AB'=v+c.v),'+',v)v
FROM @ c)z

Try it out - warning output is selected and not readable. Would be readable with print, but that is not possible using this method

What makes you think that you can't take a table as argument?

@Adám not a bad idea to create the code using a table as argument as well - I will get right on it

@Adám I guess I was wrong, in order to make the script work for 120 characters, I would need both the table and the varchar as input, I did rewrite it. It took 151 characters