text:
12 hour time conversion
Challenge
Convert and print out a time in a 12-hour format. HH:MM AM/PM
Examples
Input:

'Fri Jun 30 2017 21:14:20 GMT-0700 (PDT)'
'Fri Jun 30 2017 00:10:23 GMT-0700 (PDT)'
'Fri Jun 30 2017 12:10:23 GMT-0700 (PDT)'
'Sat Jun 31 2018 8:06:20 GMT-0700 (PDT)'
'Fri Jul 01 2017 01:14:20 GMT-0700 (PDT)'
'Sat Apr 10 2020 09:06:20 GMT-0700 (PDT)'

Ouput:

9:14 PM
12:10 AM
12:10 PM
08:06 AM
1:14 AM
09:06 AM

Fine Points

A zero before a one digit number is okay, no zero is also allowed. The following examples are both allowed:

9:06 AM

09:06 AM

All tested years will be after 999 (each year will be exactly 4 digits)

Rules

This is code-golf so the shortest solution in bytes wins
Standard Loopholes Apply
You may use functions as well as programs

Suggested test cases: 00:10:23 --> 12:10 AM and 12:10:23 --> 12:10 PM.

there we go. Feel free to edit if you see anything else I should change. thanks for the suggestion!

Related

May we assume that the time is given in the timezone the program is being run in? (e.g. 'Fri Jun 30 2017 21:14:20 GMT-0400 (EDT)' for me)

erm, June 31 doesn't exist. Is that accurate?

No zero is required. I will edit the challenge in an hour when I get home.

@pudility Thanks for clarifying. Removing close vote. I'll remove the downvote when you edit (which will unlock the vote)

Also, can the leading 0 be replaced by a space?

Sorry, But I am not sure I understand. Could you please elaborate? Also, I have edited the question, I hope this provides more clarity.

@pudility I mean if the output string can start with a space (instead of a zero) before a one digit number: _9:14 PM where _ represents a space

JavaScript (ES6), 69 bytes
d=>new Date(d).toLocaleString(0,{hour:n='numeric',minute:n,hour12:1})

f=
d=>new Date(d).toLocaleString(0,{hour:n='numeric',minute:n,hour12:1})
console.log(
  f('Fri Jun 30 2017 21:14:20 GMT-0700 (PDT)'),
  f('Fri Jun 30 2017 00:10:23 GMT-0700 (PDT)'),
  f('Fri Jun 30 2017 12:10:23 GMT-0700 (PDT)'),
  f('Sat Jun 31 2018 8:06:20 GMT-0700 (PDT)'),
  f('Fri Jul 01 2017 01:14:20 GMT-0700 (PDT)'),
  f('Sat Apr 10 2020 09:06:20 GMT-0700 (PDT)'),
)

JavaScript (ES6), 58 55 bytes
Assumes you are in the United States.
d=>new Date(d).toLocaleTimeString().replace(/:.. /,' ')

f=
d=>new Date(d).toLocaleTimeString().replace(/:.. /,' ')
console.log(
  f('Fri Jun 30 2017 21:14:20 GMT-0700 (PDT)'),
  f('Fri Jun 30 2017 00:10:23 GMT-0700 (PDT)'),
  f('Fri Jun 30 2017 12:10:23 GMT-0700 (PDT)'),
  f('Sat Jun 31 2018 8:06:20 GMT-0700 (PDT)'),
  f('Fri Jul 01 2017 01:14:20 GMT-0700 (PDT)'),
  f('Sat Apr 10 2020 09:06:20 GMT-0700 (PDT)')
)

JavaScript (ES6), 81 78 bytes
Answer before outputting a leading 0 in single-digit hours was made optional and test cases without leading 0s were added.
d=>([m,s]=d.slice(16).split`:`,`0${m%12||12}:${s} ${m<12?'A':'P'}M`.slice(-8))

f=
d=>([m,s]=d.slice(16).split`:`,`0${m%12||12}:${s} ${m<12?'A':'P'}M`.slice(-8))
console.log(
  f('Fri Jun 30 2017 21:14:20 GMT-0700 (PDT)'),
  f('Sat Jun 31 2018 08:06:20 GMT-0700 (PDT)'),
  f('Fri Jul 01 2017 01:14:20 GMT-0700 (PDT)'),
  f('Sat Apr 10 2020 09:06:20 GMT-0700 (PDT)')
)

I was thinking about changing ${m>12?'P':'A'}M to ${"AP"[m>12]}M, but it doesn't work without casting the index to an integer (like with |0), which makes it the same length. Nicely golfed.

You can omit ,21 in the slice to save 3 bytes.

Returns 12:10 AM for Fri Jun 30 2017 12:10:23 GMT-0700 (PDT). Should be PM. Changing m>12 to m>11 should fix it.

to save you 4 bytes: d=>(new Date(d).toLocaleString(0,{hour:'numeric',minute:'numeric',hour12:1}))

In fact, you could actually save 25 bytes with the following: d=>(new Date(d).toLocaleTimeString().replace(/:\d+/,''))

@RickHitchcock Fixed, thanks!

@pudility Added more answers based on your comments.

Python 2, 66 bytes
lambda s:`int(s[15:18])%12`+s[18:21]+'  APMM'[int(s[15:18])>11::2]

Try it online!

This fails for years that have less than 4 digits (although I'm unsure whether it has to work with those).

I think that is alright.

@notjagan it doesn't have to, it says so in the question.

@totallyhuman Whoops, sorry.

Can you change int(s[15:18])>11 to s[15:18]>"11"?

Or even better: s[15:]<"12" and swap the A with the P

sh + coreutils, 22 bytes
date +%I:%M\ %p -d"$1"

(If seconds are allowed, then date +%r -d"$1" suffices.)

impressively few bytes! also well done

JavaScript (ES6), 77 bytes
Assumes that the year has 4 digits.
s=>`${([,,,h,m]=s.match(/\d./g),x=h%12||12)>9?x:'0'+x}:${m} ${'AP'[h/12|0]}M`

Test cases

let f =

s=>`${([,,,h,m]=s.match(/\d./g),x=h%12||12)>9?x:'0'+x}:${m} ${'AP'[h/12|0]}M`

console.log(f('Fri Jun 30 2017 21:14:20 GMT-0700 (PDT)')) // 09:14 PM
console.log(f('Fri Jun 30 2017 00:10:23 GMT-0700 (PDT)')) // 12:10 AM
console.log(f('Fri Jun 30 2017 12:10:23 GMT-0700 (PDT)')) // 12:10 PM
console.log(f('Sat Jun 31 2018 08:06:20 GMT-0700 (PDT)')) // 08:06 AM
console.log(f('Fri Jul 01 2017 01:14:20 GMT-0700 (PDT)')) // 01:14 AM
console.log(f('Sat Apr 10 2020 09:06:20 GMT-0700 (PDT)')) // 09:06 AM

Like above, I have found a smaller way to create and answer. Feel free to use my code, I don't think that it is really fare to answer my own question. d=>(new Date(d).toLocaleTimeString().replace(/:\d+/,''))

@pudility This would only work if your Locale is en-US and your timezone is GMT-0700 (PDT). For instance, none of these assumptions are true for me.

Japt, 15 bytes
ÐU¯24)s8 r.³+SS

Try it online!
12 bytes if we can assume that the time will be given in the computer's local time:
ÐU s8 r.³+SS

Try it online!
Mathy approach, 40 bytes
tG5 r"^.."_<C?+Z+B:°TnZ)%CÄÃ+" {"AP"gT}M

Test it online!

V, 36 bytes
16x3wC AMÇ^0ü^1[0-2]/12WrP
ç^ä:/é0

Try it online!
Hexdump:
00000000: 3136 7833 7743 2041 4d1b c75e 30fc 5e31  16x3wC AM..^0.^1
00000010: 5b30 2d32 5d2f 3132 1857 7250 0ae7 5ee4  [0-2]/12.WrP..^.
00000020: 3a2f e930                                :/.0

PHP, 45 bytes
Answer improved thanks to manatwork
<?=(new DateTime($argv[1]))->format('h:i A');

First attempt:
<? $d=new DateTime($argv[1]);echo$d->format('h:i A');

Example usage through php CLI:
php d.php "Sat Apr 10 2020 09:06:20 GMT-0700 (PDT)"

This is my first golf try.

No need for variable $d and that way you can get rid of the explicit echo: <?=(new DateTime($argv[1]))->format('h:i A');.

Jelly, 43 bytes
Ḳ5ịṣ”:Ṗṁ3µV’%12‘Dµ1¦µV>11ị⁾PAµ3¦“0: M”żFṫ-7

Try it online!
This is superfluously too long! That is, Jelly sucks at time manipulation.
EDIT: I'm even outgolfed by PHP!

Go, 103 bytes
func f(s*string){t,_:=time.Parse("Mon Jan 02 2006 15:04:05 MST-0700 (MST)",*s)
*s=t.Format("03:04 PM")}

Test here: https://play.golang.org/p/P1zRWGske-

MATL, 9 bytes
5:24)16XO

Try it at MATL online! Or verify all test cases.
Explanation
5:24    % Push array [5 6 ... 24]
)       % Implicit input. Get characters at those positions. This
        % removes the first four characters with the day of the week
16      % Push 16
XO      % Convert to date string format 16, which is 'HH:MM PM'
        % Implicitly display

Can we have an explanation?

@totallyhuman Sure, thanks for reminding me. Edited. Basically the builtin XO does most of the work

05AB1E, 39 bytes
#4è':¡¨`sD11›„APès<12%>0ìR2£R)Á… :M‚øJJ

Try it online!

,,,, 41 bytes
::18⊢3⊣⇆15⊢3⊣i11>"  APMM"⇆⊢2⟛↔15⊢3⊣i12%s#

Explanation
WIP

C#, 145 bytes
namespace System.Linq{s=>{var d=DateTime.Parse(string.Join(" ",s.Split(' ').Skip(1).Take(4)));return d.ToString("h:mm ")+(d.Hour>11?"PM":"AM");}}

Full/Formatted version:
namespace System.Linq
{
    class P
    {
        static void Main()
        {
            Func<string, string> f = s =>
            {
                var d = DateTime.Parse(string.Join(" ", s.Split(' ').Skip(1).Take(4)));

                return d.ToString("h:mm ") + (d.Hour > 11 ? "PM" : "AM");
            };

            Console.WriteLine(f("Fri Jun 30 2017 21:14:20 GMT-0700 (PDT)"));
            Console.WriteLine(f("Fri Jun 30 2017 00:10:23 GMT-0700 (PDT)"));
            Console.WriteLine(f("Fri Jun 30 2017 12:10:23 GMT-0700 (PDT)"));
            Console.WriteLine(f("Fri Jul 01 2017 01:14:20 GMT-0700 (PDT)"));
            Console.WriteLine(f("Sat Apr 10 2020 09:06:20 GMT-0700 (PDT)"));

            Console.ReadLine();
        }
    }
}

PHP, 42 bytes
<?=date_create($argv[1])->format('h:i A');

Try it online!


text:
Spanish ID card control character calculator
This is a very very simple algorithm, that I am sure can be solved in many many different languages. In Spain ID cards (known as DNI) consist of 8 numbers and a control character. The control character is calculated with the following algorithm: divide the number by 23, take the remainder of the operation and replace it with a character according to this table:
0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22
T  R  W  A  G  M  Y  F  P  D  X  B  N  J  Z  S  Q  V  H  L  C  K  E

If the DNI belongs to a foreign person living in Spain, the first digit is changed to X, Y or Z and it is called an NIE. In this case, the following substitutions are made before calculating the control character:
X Y Z
0 1 2

There are a lot of calculators online that help you get the control character, but, how short can you write that code? Write an algorithm (program or function) that receives a string with the DNI number (that will always consist of 8 alphanumeric characters) and returns just the single control character calculated and nothing more (a trailing newline is accepted).
Notes:

The DNI is always written in uppercase, but in your algorithm you can choose the input and output to be upper- or lowercase, just be consistent.
In real life, some NIEs issued before 2008 have 8 digits after the X, Y or Z, but for the purposes of this game, you can consider they have 7 digits as they have nowadays.
You can consider that the input string will always have 8 characters, but if they are not in the "8 digits" format nor the "[XYZ] plus 7 digits" format, you must return an error (of your choice) or just throw an exception.

Test cases:
00000010 -> X (HRM Juan Carlos I's DNI number)
01234567 -> L
98765432 -> M
69696969 -> T
42424242 -> Y
Z5555555 -> W (Z=2)
Y0000369 -> S (Y=1)
A1234567 -> <Error code or exception>
1231XX12 -> <Error code or exception>

This is code-golf, so may the shortest code for each language win!

Sandbox.

Is it really important that the code have a specific behavior on invalid input? Usually challenges here don't require worrying about error handling.

@GregMartin my point precisely, I just wanted the code to show some specific behaviour on error inputs as it is not usually required.

In “divide the number by 23, take the rest of the operation”, the correct term is remainder; rest is too colloquial.

@Locoluis in Spanish we say resto, making "rest" a false friend, then. At least I didn't use a wrong term. :-) Thank you!

My NIE is pre-2008 (by a large stretch) and it's 7 digits... ;-)

Incredible, I came to post the exact same thing but for the french equivalent (97 - Number // 97) and you posted that just yesterday.

Python 3, 83 bytes
lambda n:'TRWAGMYFPDXBNJZSQVHLCKE'[int([n,str(ord(n[0])%4)+n[1:]][n[0]in'XYZ'])%23]

Try it online!
-5 thanks to AlixEinsenhardt (from 99 to 94). -1 thanks to JonathanAllan.

You can replace str('XYZ'.index(n[0])) by str(ord(n[0])-88) and save 5 bytes

@AlixEisenhardt The above suggestion inspired me to change the technique to a lambda, which eventually saved 10 bytes.

Save a byte by replacing -88 with %4.

Haskell, 107 93 92 bytes
c(x:y)="TRWAGMYFPDXBNJZSQVHLCKE"!!mod(read(("X0Y1Z2"!x):y))23
(a:b:c)!x|x==a=b|2>1=c!x
_!x=x

Try it online!

What's the behaviour on invalid inputs?

They will crash the program, I added one in the example. (in practice it throws an exception that nobody catches)

I updated the submission with exception catching, so that all tests could be run.

Pyth, 35 34 bytes
The code contains some unprintable characters, so here is a reversible xxd hexdump.
00000000: 402e 5043 22fc eeff 1ffc adc7 e614 9451  @.PC"..........Q
00000010: 2247 2573 7358 637a 5d31 3e33 4755 3320  "G%ssXcz]1>3GU3
00000020: 3233                                     23

Uses lowercase characters.
Try it online. Test suite.
Printable version
@.P305777935990456506899534929G%ssXcz]1>3GU3 23

Explanation

cz]1 splits the input at position 1, e.g. "y0000369" to ["y", "0000369"].
>3G gets the last 3 characters of the alphabet, "xyz".
U3 gets the range [0, 3[, [0, 1, 2].
X maps xyz to [0, 1, 2] in the split array, e.g. ["y", "0000369"] to [1, "0000369"]. This replaces the first character if it is one of xyz, while leaving the tail of 7 characters untouched since any 7 character string can't be equal to a single character.
s joins the array with the empty string, e.g. [1, "0000369"] to "10000369".
s casts this string to integer, e.g. "10000369" to 10000369. This throws an error if any extra non-digit characters are left in the string.
%…23 gets the value modulo 23, e.g. 10000369 to 15.
C"…" converts the binary string from base 256 to integer (about 3.06 × 1026).
.P…G gets the permutation of the alphabet with that index.
@ gets the correct character from the permutation.

MATL, 62 59  bytes
'RWAGMYFPDXBNJZSQVHLCKET'j'[\dXYZ]\d{7}'XXg'XYZ'I:47+XEU1))

The error for not valid input is A(I): index out of bounds (compiler running in Octave) or Index exceeds matrix dimensions (compiler running in Matlab).
Try it online!
Explanation
'RWAGMYFPDXBNJZSQVHLCKET' % Push this string (output letters circularly shifted by 1)
j                         % Unevaluated input
'[\dXYZ]\d{7}'            % Push this string (regexp pattern)
XX                        % Regexp. Returns cell arary with matching string, or empty
g                         % Convert to standard array. Will be empty if non-valid input
'XYZ'                     % Push this string
I:47+                     % Push [47 48 49] (ASCII codes of '012')
XE                        % Transliterate
U                         % Convert to number
1)                        % Get first entry. Gives an error if empty
)                         % Index (modular, 1-based) into initial string
                          % Implicitly display

ES6, 83 82 81 bytes
i=>'TRWAGMYFPDXBNJZSQVHLCKE'[(/^[XYZ]/.test(i)?i.charCodeAt()%4+i.slice(1):i)%23]

In action!
Uppercase only, the error code for invalid numbers is undefined.
One byte saved thanks to Jonathan Allan.
Another byte saved thanks to Shaggy.

Maybe save a byte using %4 rather than -88.

You should be able to drop the 0 from charCodeAt() too.

Java 8, 154 145 104 bytes
s->{s[0]-=s[0]<88|s[0]>90?0:40;return"TRWAGMYFPDXBNJZSQVHLCKE".charAt(new Integer(new String(s))%23);}

-9 bytes thanks to @OliverGrégoire.
-41 bytes thanks to @OliverGrégoire again, by taking the input as a char-array (char[]).
If the input is invalid, it will either fail with a java.lang.NumberFormatException or java.lang.StringIndexOutOfBoundsException.
Explanation:
Try it here. (Invalid test cases are surrounded by try-catch so it doesn't stop at the first error.)
s->{                      // Method with char[] parameter and char return-type
  s[0]-=s[0]<88|s[0]>90?  // If the first character is not XYZ:
    0                     //  Leave the first character as is
   :                      // Else:
    40;                   //  Subtract 40 to convert it to 012
  return"TRWAGMYFPDXBNJZSQVHLCKE".charAt(
                          //    Get the char from the String
    new Integer(          //    by converting the following String to an integer:
      new String(s)       //     by converting the char-array to a String
    )%23);                //    And take modulo-23 of that integer
}                         // End of method

You don't need the | in the regex. Also int t=s.charAt(0)-88 & t<0?t+40:t spare you a byte.

Finally, you can return an error code. Just decide that it's 'a' or '0' or any non uppercase letter, and return that instead of t/0 and casting the whole lot to char. You'd save 7 bytes this way, I guess. Golfed this way, you get 145 bytes.

@OlivierGrégoire Thanks! I have the feeling it is still possible to use a different way of validating instead of .matches with this regex, btw. But perhaps I'm mistaken.

No, you're totally right! It's doable like this: s->{s[0]-=s[0]<88?0:40;return"TRWAGMYFPDXBNJZSQVHLCKE".charAt(new Integer(new String(s))%23);} for only 94 bytes (with s being a char[]) :p

Or if you want to be complete about the validation: s[0]<88&s[0]>90 for 8 more bytes.

@OlivierGrégoire Thanks. And I was indeed looking for full validation after your first comment. I noticed a test case like [5555555 was still validating and incorrectly returning Q. But with the added |s[0]>90 (not & btw :D) it works. Thanks again.

Sorry for mixing the operators: I wrote that in a hurry. At least you're properly parsing the idea and not what I write :-P Anyways... I guess it's probably the only time where an answer with new Integer(new String(...)) is shorter than any other Java answer (so far)!

PHP, 88 bytes
prints 1 for an error

$a[0]=strtr(($a=$argn)[0],ZYX,210);echo!ctype_digit($a)?:TRWAGMYFPDXBNJZSQVHLCKE[$a%23];

Try it online!

Jelly, 42 bytes
“X0Y1Z2”⁸y@1¦RṪ€V%23ị“Ñ×ⱮEɼiʋ}'uƒẹsø’ṃØA$¤

Try it online!
Too long, Jelly! Dennis is disappointed of you![citation-needed]

JavaScript(ES6), 121 byte

f=i=>{c=+i[0];a=3;while(a--){i[0]=="XYZ"[a]&&(c=a)}b=7;while(b--){c= +i[7-b]+c*10}return "TRWAGMYFPDXBNJZSQVHLCKE"[c%23]}

console.log([f("00000010"),f("01234567"),f("98765432"),f("69696969"),f("42424242"),f("Z5555555"),f("Y0000369"),f("A1234567"),f("1231XX12")])

Japt, 50 bytes
Similar to most of the other approaches.
Input and output is lowercase, outputs undefined for invalid input.
`tr°gmyfpdxbnjzsqvhlcke`g("xyz"øUg)?Uc %4+UÅ:U %23

Test itTest all valid test cases

Rust, 206 bytes
I don't think rust is well suited for code golfing -_-
let b=|s:&str|{s.chars().enumerate().map(|(i,c)|match i{0=>match c{'X'=>'0','Y'=>'1','Z'=>'2',_=>c},_=>c}).collect::<String>().parse::<usize>().ok().and_then(|x|"TRWAGMYFPDXBNJZSQVHLCKE".chars().nth(x%23))};

05AB1E, 41 40 39 bytes
ć…xyz2ÝJ‡ìDd_i.ǝ}23%.•Xk¦fΣT(:ˆ.Îðv5•sè

Takes the input in lowercase (to save 1 byte yay)
Try it online!
Prints the input to STDERR if it is malformed
Explanation
ć…xyz2ÝJ‡ìDd_i.ǝ}23%.•Xk¦fΣT(:ˆ.Îðv5•sè
ć                                       # Get head of input and put the rest of the input under it on the stack
 …xyz                                   # Push xyz
     2ÝJ                                # Push 012
        ‡                               # Transliterate
         ì                              # Prepend to the rest of the input
          Dd_                           # Does the result contain something other than numbers?
             i.ǝ}                       # If so print input to STDERR
                 23%                    # Modulo 23
                    .•Xk¦fΣT(:ˆ.Îðv5•   # Pushes the character list
                                     sè # Get the char at the index of the modulo

q/kdb+, 68 bytes
Solution:
{"TRWAGMYFPDXBNJZSQVHLCKE"mod["J"$$[3>a:"XYZ"?x 0;($)a;x 0],1_x;23]}

Examples:
q){"TRWAGMYFPDXBNJZSQVHLCKE"mod["J"$$[3>a:"XYZ"?x 0;($)a;x 0],1_x;23]}"00000010"
"X"
q){"TRWAGMYFPDXBNJZSQVHLCKE"mod["J"$$[3>a:"XYZ"?x 0;($)a;x 0],1_x;23]}"01234567"
"L"
q){"TRWAGMYFPDXBNJZSQVHLCKE"mod["J"$$[3>a:"XYZ"?x 0;($)a;x 0],1_x;23]}"98765432"
"M"
q){"TRWAGMYFPDXBNJZSQVHLCKE"mod["J"$$[3>a:"XYZ"?x 0;($)a;x 0],1_x;23]}"69696969"
"T"
q){"TRWAGMYFPDXBNJZSQVHLCKE"mod["J"$$[3>a:"XYZ"?x 0;($)a;x 0],1_x;23]}"42424242"
"Y"
q){"TRWAGMYFPDXBNJZSQVHLCKE"mod["J"$$[3>a:"XYZ"?x 0;($)a;x 0],1_x;23]}"Z5555555"
"W"
q){"TRWAGMYFPDXBNJZSQVHLCKE"mod["J"$$[3>a:"XYZ"?x 0;($)a;x 0],1_x;23]}"Y0000369"
"S"
q){"TRWAGMYFPDXBNJZSQVHLCKE"mod["J"$$[3>a:"XYZ"?x 0;($)a;x 0],1_x;23]}"A1234567"
" "
q){"TRWAGMYFPDXBNJZSQVHLCKE"mod["J"$$[3>a:"XYZ"?x 0;($)a;x 0],1_x;23]}"1231XX12"
" "

Explanation:
If the first character, x 0, is in the string "XYZ" then a will be 0, 1 or 2. If the first character is not in the string, then a will be 3. If a is less than 3, we switch out the first character for the string of a (0, 1 or 2), otherwise we switch out for the first character (thus effectively doing nothing).
This string is cast to a long ("J"$), which is then mod'd with 23 to give the remainder.
This remainder is used to index into the lookup table.
{ "TRWAGMYFPDXBNJZSQVHLCKE" mod["J"$$[3>a:"XYZ"?x 0;string a;x 0],1_x;23] } / ungolfed solution
{                                                                         } / lambda function
                            mod[                                     ;23]   / performds mod 23 of the stuff in the gap
                                                                  1_x       / 1 drop input, drops the first character
                                                                 ,          / concatenation
                                    $[             ;        ;   ]           / if COND then TRUE else FALSE - $[COND;TRUE;FALSE]
                                        a:"XYZ"?x 0                         / "XYZ" find x[0], save result in a
                                      3>                                    / is this result smaller than 3
                                                    string a                / if so, then string a, e.g. 0 -> "0"
                                                             x 0            / if not, just return first character x[0]
                                "J"$                                        / cast to long
  "TRWAGMYFPDXBNJZSQVHLCKE"                                                 / the lookup table

Notes:
" " is returned in the error scenarios, this is because the cast returns a null, and indexing into a string at index null is an empty char. I could add 4 bytes at the beginning ("!"^) to make it more obvious that an error had occurred:
q){"!"^"TRWAGMYFPDXBNJZSQVHLCKE"("J"$$[3>a:"XYZ"?x 0;($)a;x 0],1_x)mod 23}"1231XX12"
"!"

Dyalog APL, 95 bytes
{'TRWAGMYFPDXBNJZSQVHLCKE'[1+23|(10⊥¯1+'0123456789'⍳{(⍕{('XYZ'⍳⍵)<4:('XYZ'⍳⍵)-1⋄⍵} ⊃⍵),1↓⍵}⍵)]}
This is a monadic operator that accepts a character string as its operand and returns its result.
FIXME it doesn't check its input. It's not properly golfed.
Usage:
    OP ← {'TRWAGMYFPDXBNJZSQVHLCKE'[1+23|(10⊥¯1+'0123456789'⍳{(⍕{('XYZ'⍳⍵)<4:('XYZ'⍳⍵)-1⋄⍵} ⊃⍵),1↓⍵}⍵)]}

      OP '01234567'
L

      OP '00000010'
X

source: Stack Exchange

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

sort: votes


text:
It was just a bug
Inspired by the bugged output in @Carcigenicate's Clojure answer for the Print this diamond challenge.
Print this exact text:
1        2        3        4        5        6        7        8        9        0
1       2       3       4       5       6       7       8       9       0
1      2      3      4      5      6      7      8      9      0
1     2     3     4     5     6     7     8     9     0
1    2    3    4    5    6    7    8    9    0
1   2   3   4   5   6   7   8   9   0
1  2  3  4  5  6  7  8  9  0
1 2 3 4 5 6 7 8 9 0
1234567890
1 2 3 4 5 6 7 8 9 0
1  2  3  4  5  6  7  8  9  0
1   2   3   4   5   6   7   8   9   0
1    2    3    4    5    6    7    8    9    0
1     2     3     4     5     6     7     8     9     0
1      2      3      4      5      6      7      8      9      0
1       2       3       4       5       6       7       8       9       0
1        2        3        4        5        6        7        8        9        0

(From the middle outward in both directions, each digit is separated by one more space than the previous line.)
Challenge rules:

There will be no input (or an empty unused input).
Trailing spaces are optional.
A single trailing new-line is optional.
Leading spaces or new-lines are not allowed.
Returning a string-array isn't allowed. You should either output the text, or have a function which returns a single string with correct result.

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, 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.
Also, please add an explanation if necessary.

Is outputting an array of strings - 1 string per line - allowed?

@Shaggy Sorry, in this case it should either return a single string with new-lines, or output the result. I've added this as rule to the challenge.

No worries, Kevin; was just chancing my arm to see if I could save myself a couple of bytes.

@Shaggy Hehe. What other reason would we have to ask question in a code-golf challenge, besides having the purpose of saving those few bytes? ;)

Ha, that's awesome. I was wondering why that answer suddenly got so much attention. Thanks!

MathGolf, 11 bytes
8╤{± *♂r╫up

Try it online!
Explanation
8             push 8
 ╤            range(-n, n+1)
  {           for each element in range:
   ±          absolute value
              space character
     *        multiply space character x number of times
      ♂r      push 10, create range
        ╫     left-rotate list (0 goes to the end)
         u    join with separator (joins using x spaces)
          p   print with newline

Has a trailing newline in the end from printing. @ovs found a mistake in the original code that could be fixed by switching the first 9 to an 8.

I'm pretty sure the 9 should be an 8 instead. This has more lines in the output than the text in the challenge.

Good catch! This was a long time ago, and I guess that I must've just thought that the outputs were identical.

Python 2,  59 57 56 55 bytes
i=8;exec"print(' '*abs(i)).join('1234567890');i-=1;"*17

Try it online!

@Leaky Nun helped golfing this a lot, @Praind Suggested a method to save 1 byte, which I formerly thought of, but forgot to edit, @CotyJohnathanSaxman suggested changing the loop.

Explanation

i=8 - Assigns the value 8 to a variable called i.

exec"..."*17 - Execute that block of code (...) 17 times.

print(...) - Output the result.

' '*abs(i) - Create a String with a space repeated |i| times.

.join('1234567890') - Interleave the string created above with 1234567890, such that |i| spaces are inserted between the digits.

i-=1 - Decrement i, and by executing it 17 times, it reaches -8, which creates te repetitive pattern with the help of abs().

76 bytes

@LeakyNun Just updating with 77 :P

62 bytes

59 bytes

This is farm more impressive than 25 bytes in any golfing language imho.

@Jylo Thanks, but the 25 byte-solutions are very impressive, since they show lots of golfing efforts made by their authors. You should first know what each character in their source means, and then you will understand how beautifully golfed they are.

You can save one more byte by losing the 'range' for a 'while'. Try it online!

You can save another byte. Start with positive 8 and decrement it at the end. With that you omit the minus character :)

Just a noob programmer asking a noob question: Can't you replace i-=1 with i--, saving a byte?

@JasonChen No, Python does not allow that syntax, because that's specific to C-like languages.

Possible inspiration: Can be done without exec in 55 bytes as well. Used a similar approach to get Python 3 down to 57 bytes. Didn't see any obvious way to get it shorter, by omitting exec, but figured I'd mention it as a possibility.

Vim, 35 bytes:
i1234567890<esc>qqYP:s/\d/& /g
YGp{q7@q

Explanation:
i1234567890<esc>    " insert '1234567890'
qq                  " Record the following into register 'q'
  Y                 "   Yank a line
   P                "   Paste it above us
    :s/\d/& /g      "   Put a space after each number
Y                   "   Yank this line
 G                  "   Move the end of the buffer
  p                 "   Paste the line
   {                "   Move the beginning of the buffer
    q               " Stop recording
     7@q            " Call macro 'q' 7 times

I don't even care that this isn't the winner, it's beautiful.

@MrDuk Thankyou! I'm glad you like it :)

05AB1E,  14  13 bytes
17F9ÝÀN8αð×ý,

Try it online!
Explanation
17F            # for N in [0 ... 16] do
   9Ý          # push [0 ... 9]
     À         # rotate left
      N8α      # compute the absolute difference between N and 8
         ð×    # push that many spaces
           ý   # merge the list of digits with the space string as separator
            ,  # print

Hmm...you could've beaten SOGL if you didn't need the s...does it make sense to join a string with a list or a list with a string? I'll suggest improvement to Adnan. Oh, and there's .∊ for û».

@EriktheOutgolfer: Or I could switch up my method and save that 1 byte I needed :)

Sorry already upvoted.

@EriktheOutgolfer: I don't see what that has to do with anything. Thanks for notifying me that I needed to golf my answer :)

That means I'd have upvoted again...

@EriktheOutgolfer let me do it for you.... Here we go.

8F9ÝÀNð×ý}».∊ I done did made a spaceship maw! And I was all excited about suggesting a 12-byte edit.

@MagicOctopusUrn: Hehe, yeah I made a spaceship while golfing as well :)

Hi, someone else just posted a 12-byte solution. Since it's been a couple of months ago since I accepted yours, I'm not sure what the policy is. Since the other one is shorter, I'm thinking about accepting that one, but since I feel it's also unfair to you I'd like to ask your opinion about this first as well. Should I leave the accepted mark, or accept another answer if a shorter one comes up in the future?

There are lots of alternate 13s, like 9LRûv9ÝÀÀyjÁ, or 9LR©ûv®yjR?0,. It feels like 12 should be possible.

C64 ASM, 358 bytes (102 bytes compiled with basicstub)
This is the closest I could get due to obvious limitations:

jsr $E544
lda #9
sta $FD
nl1: jsr dl
jsr il
dec $FD
bne nl1
inc $FD
nl2: ldy $FD
cpy #9
bne nt1
bl: jmp bl
nt1: iny
sty $FD
jsr dl
jsr il
jmp nl2
dl: clc
ldx #$31
ldy #0
lp: txa
sm: sta $0400, y
inx
cpx #$31
bne c1
rts
c1: cpx #$3A
bne nt2
ldx #$30
clc
nt2: tya
adc $FD
cmp #40
bcc c2
rts
c2: tay
jmp lp
il: lda sm+1
adc #39
bcc nc
inc sm+2
nc: sta sm+1
rts

(Could probably be optimized quite a bit)

Welcome to PPCG! Please use code tag to post pretty. I edited you post. After changes apply you can see, what changed by clicking edit

I've just checked and it won't even fit on an 80 cols PET as the first and last line require 82 columns.

TSQL, 220 148 bytes
Improvement posted by ZLK:
DECLARE @ VARCHAR(MAX)=''SELECT TOP 17@+=REPLACE('1@2@3@4@5@6@7@8@9@0','@',SPACE(ABS(9-RANK()OVER(ORDER BY object_id))))+'
'FROM sys.objects PRINT @

Output:
1        2        3        4        5        6        7        8        9        0
1       2       3       4       5       6       7       8       9       0
1      2      3      4      5      6      7      8      9      0
1     2     3     4     5     6     7     8     9     0
1    2    3    4    5    6    7    8    9    0
1   2   3   4   5   6   7   8   9   0
1  2  3  4  5  6  7  8  9  0
1 2 3 4 5 6 7 8 9 0
1234567890
1 2 3 4 5 6 7 8 9 0
1  2  3  4  5  6  7  8  9  0
1   2   3   4   5   6   7   8   9   0
1    2    3    4    5    6    7    8    9    0
1     2     3     4     5     6     7     8     9     0
1      2      3      4      5      6      7      8      9      0
1       2       3       4       5       6       7       8       9       0
1        2        3        4        5        6        7        8        9        0

DECLARE @ VARCHAR(MAX)=''SELECT TOP 17@+=REPLACE('1@2@3@4@5@6@7@8@9@0','@',SPACE(ABS(9-RANK()OVER(ORDER BY object_id))))+' 'FROM sys.objects PRINT @

Replace sys.objects with sysobjects, and 1object_idwithidI looked for shorter tables in thesysschema, but nothing short had columns as short assysobjects`

And you can save another few bytes by changing the inner CAST (with the POWER(10)) to VARCHAR

In fact, avoid all that replace stuff by using LOG10 and REPLICATE: DECLARE @o VARCHAR(MAX)=''SELECT TOP 17 @o+=REPLACE('1@2@3@4@5@6@7@8@9@0','@',replicate(' ',LOG10(POWER(10,ABS(ROW_NUMBER()OVER(ORDER BY id)-9)+1)/10)))+' 'FROM sysobjects PRINT @o

You can change the variable name to just @ to shave off 3 characters.

APL (Dyalog), 22 bytes
↑∊¨(1+|¯9+⍳17)↑¨¨⊂1⌽⎕D

Try it online!
⎕D Digits from zero to nine
1⌽ rotate one step right (puts zero at end)
⊂ enclose (to treat as unit)
(…)↑¨¨ for each of these numbers, take that many characters from each of the letters:
 ⍳17 one through seventeen
 ¯9+ subtract nine
 | find the absolute values
 1+ add one
∊¨ enlist (flatten) each
↑ change one layer of depth into a level of rank (matrify)

In a compact language like this it seriously takes two bytes to add one?

@aschepler Yes. APL is not a golfing language, and doesn't have an increment primitive. J does, but it takes two bytes; >:.

APL is not a golfing language ... ↑⊃¨,/¨(1+|¯9+⍳17)↑¨¨⊂1⌽⎕D ... ಠ_ಠ

@Alexander Thanks for getting my attention back to this one. I could golf 3 bytes.

Haskell, 58 55 bytes
unlines["1234567890">>=(:(' '<$[1..abs n]))|n<-[-8..8]]

Try it online!
This is basically @nimi 's solution :)

Japt -R, 19 18 16 14 13 bytes
Aõ%A
£qYçÃÔÅê

Test it or try it online

Explanation
A             :10
 õ           :Range [1,10]
  %A         :Modulo each by 10
\n           :Assign to variable U
£            :Map each element at 0-based index Y
 q           :  Join U with
  Yç         :   Space repeated Y times
    Ã        :End map
     Ô       :Reverse
      Å      :Slice off first element
       ê     :Mirror
             :Implicitly join with newlines and output

Nice. My 16-byte solution was 9ÆAõ%A qXîÃw ê ·

Java 11 (JDK), 98 bytes
o->{for(int i=-9;++i<9;)System.out.println("".join(" ".repeat(i<0?-i:i),"1234567890".split("")));}

Try it online!

-14 bytes by switching to JDK 11, which now has a native String::repeat.

Previous answer (Java (OpenJDK 8)), 113 112 bytes
o->{for(int i=-9;++i<9;)System.out.printf("".join("%1$"+(i<0?-i:i>0?i:"")+"s","1234567890".split(""))+"%n","");}

Try it online!
Explanations
I'm basically constructing the following String 17 times (N is a variable, not an actual value):
"1%1$Ns2%1$Ns3%1$Ns4%1$Ns5%1$Ns6%1$Ns7%1$Ns8%1$Ns9%1$Ns0%n"

It's all the expected digits, joined by %1$Ns where N is the number of spaces between each digit.
%1$Ns basically means "take the first argument and pad it until length is at least N". Also, %1$0s is not supported so a special case %1$s is made for 0.
Finally, I format-print that string using a single argument: "", so the formatter reuses always the same empty string, padding it with spaces as needed.
Saves

1 byte thanks to Kevin Cruijssen

Nice answer! Btw, I explicitly mentioned in the challenge an unused empty parameter is allowed, so you can replace ()-> with o-> to save a byte. :)

Can you make o an int and use it in your for loop ? for(o=-9;++o<9;)

@Winter No, because the challenge says "unused", and that would use the parameter variable, even if the value wouldn't be used.

@OlivierGrégoire It links to this post https://codegolf.meta.stackexchange.com/questions/12681/are-we-allowed-to-use-empty-input-we-wont-use-when-no-input-is-asked-regarding and this posts only says it should be empty (0 for ints).

@Indeed Indeed, but the challenge itself says "unused". Specific rulings in a challenge overrule defaults.

Just came across this answer again. In Java 11 this can become 98 bytes with the use of " ".repeat :D I liked your original answer with printf more though, but figured it's worth mentioning. EDIT: Just noticed you are asking about updating the JDK in the talk.tio chat. XD Was about to do that myself.

Python 3, 58 57 54 bytes
i=8
while i+9:print(*'1234567890',sep=' '*abs(i));i-=1

Try it online!
(thanks to @flornquake for the last three bytes; I completely forgot using sep to save vs. .join)

54 bytes: while i+9:print(*'1234567890',sep=' '*abs(i));i-=1

Clojure, 126 99 bytes
-27 by fixing a couple of dumb mistakes. The outer use of a wasn't necessary, so I was able to get rid of a altogether and just write apply str once. That also allowed me to use a function macro for the main function, which saved some bytes. I also inlined the call to Math/abs instead of rebinding n-spaces.
Basically a Clojure port of @Mr.Xcoder's Python idea. In retrospect, I should have used the abs/range method for the diamond challenge originally, but I then I may not have produced the bugged output!
Pretty simple. Joins the number string with a number of spaces that depends on the current row.
#(doseq[n(range -8 9)](println(clojure.string/join(apply str(repeat (Math/abs n)\ ))"1234567890")))

(defn bugged []
  (doseq [n-spaces (range -8 9)]
    (println
        (clojure.string/join
          ; "String multiplication"
          (apply str
                 (repeat (Math/abs n-spaces) \space))
          "1234567890"))))

SOGL V0.12, 12 bytes
9{SUē↕∑}¹№╬«

Try it Here!
Explanation:
9{     }      9 times do
  SU            push "1234567890"
    ē           push e, predefined with the input, which defaults to 0, and then increase it
     ↕          get that many spaces
      ∑         join the string of digits with those spaces
        ¹     collect the results in an array
         №    reverse the array vertically
          ╬«  palindromize vertically with 1 overlap

Oh nice, this is even shorter than the accepted answer. Hmm, what is the policy on shorter answers a couple months after an answer has been accepted? Does this now get the check (kinda unfair to the currently accepted answer I think), or should I do something else? Great answer regardless! +1 from me.

@KevinCruijssen Usually the best practice is to update the accepted answer, but as this uses a couple new features, I'd say there's reason to go either way - you choose.

JavaScript(ES2017), 83 73 72 68 bytes
Thanks Shaggy for saving 10 bytes.
Thanks Craig for saving 1 byte.
Thanks arcs for saving 4 bytes.
for(i=-9,a="";i++<8;)a+=[...`1234567890
`].join("".padEnd(i<0?-i:i))

for(i=-9,a="";i++<8;)a+=[...`1234567890
`].join("".padEnd(i<0?-i:i))

console.log(a);
.as-console-wrapper { max-height: 100% !important; top: 0; }
.as-console-row:after { display: none !important; }

Save 1 byte by using a polyfill for Math.abs. I also made the a list not hardcoded, but that's a preference... a=[...Array(10).keys()];for(i=-8;i<9;i++)console.log(a.join(' '.repeat(i<0?-i:i)))

Save some bytes with [..."1234567890"].join("".padEnd(i<0?-i:i))

@Shaggy Thanks. That saved 10 bytes. :)

@ThomasW I used [...'1234567890'], it saved 3 bytes. Thanks for the polyfill.

@ThomasW: [...Array(10).keys] would have 0 as the first element, not the last.

You can save a byte using your method storing the result in a string rather than logging: for(i=-8,s="";i<9;i++)s+=[..."1234567890"].join("".padEnd(i<0?-i:i))+\X`, where X` is an actual newline

This would be considered JavaScript (ES8) due to its use of padEnd.

@CraigAyre Thanks. And nice to see you here. :)

@darrylyeo True. I've mentioned it.

You can save even more by shorting the for to for(i=-9,a="";i++<8;) and defining the array as  [...1234567890
] (line break as last character of this), with that you can remove the last addition.

@arcs Thanks. Answer updated. :)

Brachylog, 30 29 28 bytes
Ị↺{∧≜;Ṣj₍g;?↔zcc}ᶠ⁹↔;XcP↔Pẉᵐ

Try it online!
Saved one byte thanks to Leaky Nun.
Explanation
Ị↺                               The string "1234567890"
  {               }ᶠ⁹            Find the first 9 outputs of:
   ∧≜                              Take an integer
       ;Ṣj₍                        Juxtapose " " that number of times
           g;?↔z                   Zip that string of spaces with "1234567890"
                cc                 Concatenate twice into one string
                    ↔            Reverse the resuling list
                     ;XcP↔P      Palindromize the list (concatenate X to it into the list P,
                                   P reversed is still P)
                           ẉᵐ    Map writeln

28 bytes

@LeakyNun I got stuck on the big "Print this exact text" and didn't read that we could have trailing lines…

23 bytes

@LeakyNun Why didn't you post your own answer?

Pyth, 14 13 bytes
1 byte thanks to Mnemonic.
V17j*da8NeMST

Try it online!

You can save a byte if you loop instead of mapping and joining. Try it here.

Charcoal, 18 bytes
Ｆ⁹⪫⁺…Ｉ¹:⟦0¶⟧× ι‖Ｂ↑

Try it online! Link is to verbose version of code. Explanation:
Ｆ⁹      Repeat 9 times (i = loop variable)
  ⪫       Join
   ⁺       Concatentate
    …Ｉ¹:    All the characters from str(1) below ":" (i.e. to "9") as a list
    ⟦0¶⟧    A list whose element is the string "0\n"
   × ι     With i spaces
‖Ｂ↑     Reflect everything upwards but without duplicating the top line

Note: Cast(1) takes the same number of bytes because "1" would need a separator before ":" (which as it happens the deverbosifier fails to insert).

R, 108 bytes
for(i in abs(-8:8))cat(paste0(el(strsplit("1234567890","")),paste(rep(" ",i),collapse=""),collapse=""),"\n")

Just pasting and collapsing the strings.
Try it online!
Edit: thanks for Challenger5 for pointing out a problem. Fixed it now.
Edit 2: saved a byte thanks to bouncyball.

Welcome to the site! :)

This doesn't look quite right - the middle line shouldn't have any spaces at all.

@Challenger5 you are right! fixed it by using paste0 instead of paste so had to add a byte:(

save 2 bytes using el: el(strsplit("1234567890","")) instead of strsplit("1234567890","")[[1]]

You can get rid of one of the paste statements by using the sep argument to cat and doing a bit more to get it to 70 bytes

@Giuseppe I think you can post this as a separate answer (and also golf it down to 51 bytes...)

@JayCe if you have to big of a golf, you should post it yourself!

@Giuseppe nah... you should post the 70 bytes answer which is the big improvement :)

Java 8, 235 234 206 163 bytes
interface A{static void main(String[]a){for(int i=-8;i<9;i++){String s="";for(int j=1,k;j<10;j++){s+=j;for(k=0;k<(i>0?i:-i);k++)s+=" ";}System.out.println(s+0);}}}

Update : -28 bytes thanks to Leaky Nun !
Update 2 : -43 bytes thanks to Leaky Nun again !
Ungolfed :
interface A {
    static void main(String[] a) {
        for (int i = -8; i < 9; i++) {
            String s = "";
            for (int j = 1, k; j < 10; j++) {
                s += j;
                for (k = 0; k < (i > 0 ? i : -i); k++)
                    s += " ";
            }
            System.out.println(s + 0);
        }
    }
}

Try it online
EDIT : The code earlier was wrong ! Made a mistake while golfing the code, it should work as intended now !

Welcome to PPCG! Tips for golfing in Java and Tips for golfing in  might be interesting to read through. :) Some things you can golf is removing the public, and get rid of some unnecessary spaces. And there are some more things to improve, but I suggest to read through the tips, and see where you can improve yourself. Again welcome, and enjoy your stay! :)

Hmm, also, are you sure you've posted the correct code? When I copy-paste your code into TryItOnline it doesn't give the correct output.

Aww damn, i did something wrong while golfing the code ! I'll fix this !

206 bytes: some preliminary golfing

186 bytes: remove f and merge into main with a loop

163 bytes: remove m also and merge into main

171 bytes: combine two loops into one

148 bytes: one loop

Nice one, @LeakyNun, that last one is one byte shorter than my Java answer (if used in the same format). Also, you can extract i%79 in a variable to gain a few bytes.

144 bytes

Nicely fixed after your first edit. :) And golfed a lot of course by LeakyNun afterwards.

not much but saves you 5 bytes for(int i=-8,j,k;i++<9;){String s="";for(j=1;j<10;){s+=j++;for(k=0;k++<(i>0?i:-i);)s+=" ";}System.out.println(s+0);}

Husk, 21 bytes
mΣṪ`:§+↔tḣR8' ṁs`:0ḣ9

This is a full program that prints to STDOUT.
Try it online!
There are lots of trailing spaces.
Explanation
Husk is still missing lots of essential stuff like a two-argument range function, so parts of this solution are a little hacky.
mΣṪ`:§+↔tḣR8' ṁs`:0ḣ9
              ṁs`:0ḣ9  This part evaluates to the string "1234567890".
                   ḣ9   Range from 1 to 9.
                `:0     Append 0.
              ṁs        Convert each number to string and concatenate.
     §+↔tḣR8'          This part evaluates to a list like ["  "," ",""," ","  "]
                       but with 17 elements instead of 5.
          R8'           A string of 8 spaces.
         ḣ              Take prefixes.
     §+                 Concatenate
       ↔                the reversal and
        t               tail of the prefix list, palindromizing it.
  Ṫ                    Take outer product of the two lists
   `:                  with respect to flipped prepeding.
                       This prepends each digit to each string of spaces.
mΣ                     Map concatenation over the results, computing the rows.
                       Implicitly join with newlines and print.

You could replace ṁs\:0ḣ9withuṁsḣ10` to generate the string "1234567890" with one fewer byte!

T-SQL 145 152 bytes
DECLARE @ VARCHAR(MAX)=''SELECT TOP 17@+=REPLACE('1x2x3x4x5x6x7x8x9x0','x',SPACE(ABS(number-8)))+'
'FROM master..spt_values WHERE type='P'PRINT @

Updated to use:

master..spt_values to generate numbers (WHERE type = 'P', these are always consecutive, starting at 0)
@ZLK's TOP 17 idea
PRINT (to obey the rules - no stringlists)
@JanDrozen's great idea of including the carriage return in the string (I counted that as just one byte - Windows CRLF what?)
Idea of @Bridge to use just @ for variable name - all these tricks!!

Results:
1        2        3        4        5        6        7        8        9        0
1       2       3       4       5       6       7       8       9       0
1      2      3      4      5      6      7      8      9      0
1     2     3     4     5     6     7     8     9     0
1    2    3    4    5    6    7    8    9    0
1   2   3   4   5   6   7   8   9   0
1  2  3  4  5  6  7  8  9  0
1 2 3 4 5 6 7 8 9 0
1234567890
1 2 3 4 5 6 7 8 9 0
1  2  3  4  5  6  7  8  9  0
1   2   3   4   5   6   7   8   9   0
1    2    3    4    5    6    7    8    9    0
1     2     3     4     5     6     7     8     9     0
1      2      3      4      5      6      7      8      9      0
1       2       3       4       5       6       7       8       9       0
1        2        3        4        5        6        7        8        9        0

(Thanks @JanDrozen for the REPLACE idea)

This is a nice answer! Welcome to the site :)

Thanks. I see some of us have invented our own languages here :)

A mix between this answer and the other is optimal: e.g. SELECT TOP 17REPLACE('1x2x3x4x5x6x7x8x9x0','x',SPACE(ABS(9-RANK()OVER(ORDER BY object_id))))FROM sys.objects (assuming you don't need to print).

Aha @ZLK - a few nice tricks - TOP 17, RANK OVER, and sys.objects - thank you!

Mathematica, 92 bytes
Column@Join[Reverse@(s=Row/@Table[Riffle[Range@10~Mod~10,""<>Table[" ",i]],{i,0,8}]),Rest@s]

Try it online
copy/paste code with ctrl-v
press shift+enter to run

Could you perhaps add a TryItOnline link?

@KevinCruijssen Mathematica is not a free language, and Mathics doesn't seem to work.

@LeakyNun Ah ok, thanks. I see MartinEnder post TIO-links sometimes, but those were indeed Mathics links.

@Kevin Cruijssen yes of course, I added link with instructions

Jelly, 15 bytes
8ŒRA⁶ẋØDṙ1¤jÐ€Y

Try it online!

C, 97 bytes
i=-9;main(j){for(;++i<9;putchar(10))for(j=0;++j<11;printf("        "+8-abs(i)))putchar(48+j%10);}

Your compiler will probably complain a lot about this code; mine threw 7 warnings of 4 different types. Might improve the code later.
Try it online!

SOGL V0.12, 14 bytes
ā9{SUčf@*∑Κ}╬Æ

Try it Here!
Explanation:
ā               push an empty array
 9{        }    9 times do
   SU             push "1234567890"
     č            chop into characters
      f@*         get current iteration (0-based) amount of spaces
         ∑        join with that
          Κ       prepend this to the array
            ╬Æ  palindromize vertically with 1 overlap

Charcoal, 21 20 19 18 bytes
Ｆ⁹«Ｆ…¹χ⁺κ… ι0⸿»‖Ｂ↑

Try it online!
Link to the verbose version. Basically I create the lower part of the drawing and then reflect the text up.

When I saw the question I though I'd try this myself in Charcoal before looking at the answer. I started with a 21-byte answer but golfed it to 20 bytes... spooky!

@Neil :-D Well, it's 19 bytes now!

Yup, just found that golf myself. I was also looking into Ｅ…⁹⪫Ｅ…·¹χＩ﹪κχ× ι‖Ｂ↑ (also for 19 bytes) but the interpreter doesn't seem to like it (I can't see what's wrong with it myself).

Oh, Range takes two arguments, silly me.

@Neil I've never managed to write an answer in Charcoal using the map (Ｅ) operator...

My best Map attempt is still 20 bytes: Ｆ⁹⪫⁺Ｅ…¹χＩκ⟦0¶⟧× ι‖Ｂ↑. (Edit: typo fix)

Turns out Map was a red herring, so I've now posted my 18-byte answer.

CJam, 21 bytes
A,(+aH*ee{:\8-zS**n}/

Try it online!
Explanation
A,     e# Get [0 1 2 ... 9].
(+     e# Rotate the 0 to the end.
aH*    e# Wrap in an array and repeat 17 times.
ee     e# Enumerate. This pairs each copy of the array with its index in
       e# the list.
{      e# For each [index array] pair...
  :\   e#   Unwrap the pair and swap its order.
  8-z  e#   Get the absolute difference of the index from 8.
  S*   e#   Get a string of that many spaces.
  *    e#   Riffle the list of digits with the string of spaces.
  n    e#   Print it with a trailing linefeed.
}/

Alternative solution (also 21 bytes): 9{S*A,(+\*}%_W%);\+N*

PHP, 69 bytes
for(;$i<17;)echo join(str_pad("",abs($i++-8)),range(1,9)+[9=>0]),"
";

Try it online!

Batch, 163 bytes
@set s=1 2 3 4 5 6 7 8 9 0
@set t=
@for %%l in (9 7)do @for /l %%i in (1,1,%%l)do @call:%%l
:7
@set t=  %t%
:9
@set t=%t:~1%
@call echo %%s: =%t%%%

Note: First line ends in 9 spaces. Explanation: Uses creative line numbering! The first loop needs to run 9 times and delete a space each time, while the second loop needs to run 8 times and add a space each time. The former is achieved by running it 7 times and falling through for the 8th time, while the latter is achieved by adding two spaces and falling through to delete one of them again.

bash (and shell utils), 69 bytes
for i in `seq 9 -1 1;seq 2 9`;do seq -f%-$i.f 9|tr -d \\n;echo 0;done

C (gcc), 76 bytes
f(x,y){for(y=-9;++y<9;puts(""))for(x=10;x++;printf("%-*d",abs(y)+1,x%=10));}

Try it online!
It outputs some trailing spaces, which is supposed to be OK.
It prints the numbers using left-justified fields of dynamic length - that's what the format string %-*d is for.
The inner loop has some funny initialization (starts from 10; any multiple of 10 would be fine) to "simplify" its termination condition.

75 bytes

Perl 5, 31 29 bytes
$,=$"x abs,say 1..9,0for-8..8

Try it online!

PowerShell, 30 bytes
8..0+1..8|%{1..9+0-join' '*$_}

Try it online!
Constructs a range of 8,7,6...2,1,0,1,2...8 then loops through each number. Inside the loop we construct a range of 1..9 concatenated with 0 then -join the numbers in the range together with the appropriate number of spaces. Each string is left on the pipeline, and output is implicit at program completion.

Nice answer! Powershell suddenly feels more golfy :)

jq -nr, 50 46 45 bytes
[range(9)+1,0|@sh]|join(range(17)-8|" "*fabs)

Try it on jqplay!
[range(9)+1,0|@sh] generates the array ["1", "2", ..., "9", "0"]. This list is then joined by each of the results from:
range(17)-8: -8, -7, ..., 7, 8
" "*fabs a string of absolute value spaces

Sorry...

@emanresuA Yeah I've seen that before writing the answer. I will let you know when I posted an answer to a challenge you haven't

perl 5: 43, 39, 31 bytes
Needs -E flag (which is free per our consensus).
map{$,=$"x abs;say 1..9,0}-8..8

Usage:
perl -E 'map{$,=$"x abs;say 1..9,0}-8..8'

Thanks to Dada

That's nice! -E flag is free per our consensus. Also, you probably wanted -8..8 instead of -8..9. And you can save a few bytes by playing with $, instead of $": map{$,=$"x abs;say 1..9,0}-8..8 (31 bytes).

@Dada:You're right, thank you, 4 bytes saved!

You don't even need to declare @l: just use say 1..9,0 :)

JavaScript, 67 Bytes
f=(i=8)=>i+9?[...`1234567890
`].join(''.padEnd(i<0?-i:i))+f(i-1):''

f=(i=8)=>i+9?[...`1234567890
`].join(''.padEnd(i<0?-i:i))+f(i-1):''

console.log(f())

LOGO, 58 57 bytes
for[j 8 -8][repeat 9[type # repeat abs :j[type "\ ]]pr 0]

This should be run on new versions of FMSLogo (link above), where # is repcount in repeat loops. That is a new feature in FMSLogo, which seems to be undocumented.

Common Lisp, 85 bytes
(dotimes(i 17)(format t(format()"~~{~~,,~aa~~}
"(abs(- i 8)))'(1 2 3 4 5 6 7 8 9 0)))

Try it online!
format “magic” of Common Lisp:
(dotimes (i 17)                     ; for i from 0 to 16
  (format t                         ; print with a format string generated from the next call
          (format ()                ; with nil as parameter generates a string instead of printing
                  "~~{~~,,~aa~~}
"                                   ; generate the format string "~{~,,na~}~%" with n given
                  (abs(- i 8)))     ;     by the value of abs(i-8) (number of spaces)
          '(1 2 3 4 5 6 7 8 9 0)))  ; the data to be printed for each line

MATL, 21 bytes
-9Zv"l4Y29YS10:q@*Q(c

Try it online!
Explanation:
-9Zv                  % Generates [9 ... 2, 1, 2, ... 9].
    "                 % Iterate over this vector.
                   (  % Assignment indexing. Places elements B at positions C in existing vector A.
     l                %   A: Dummy vector with numeric [1] in it. Is always overwritten by char '1'.
      4Y29YS          %   B:  '0':'9', circularly shifted 9 positions to get '1':'9','0'
            10:q@*Q   %   C: Equally spaced indexing vector, spacing based on loop variable @.
                    c % Convert to char, because A was numeric.

Golfing done:
-9Zv     -->  built-in, instead of -8:8|Q or even 8:PQ9:h|
10:q@*Q  -->  2 bytes shorter than l@@10*3$:
l ... c  -->  1 byte shorter than 'x' (char dummy vector A)

I have attempted to get rid of the 9YS by doing the circular shift in the indexing, but this increased the byte count (10t:qwX\q@*Q instead of 9YS10:q@*Q). However, some interesting patterns were obtained in the process: Try it online!, Try it online!.

QBIC, 36 32 bytes
[-8,8|?[|?!b%z$';space$(abs(a));

Explanation
[-8,8|     FOR a = -8; a <= 8; a++      Sets upthe number of lines
?          Kick off each line with a \n
[|         FOR b = 1; b <= 10; b++      Loop over each digit: default behaviour for a no-arg FOR declaration
?          PRINT
 !   $     a strng cast (suppresses QBasic's tendency to space out numbers)
  b%z      of b modulo 10 (z is 10 in QBIC)
 '         Then take the next bit of code as literal QBasic
 ;         Suppress newlines and tabs
 space$    Add x spaces to the output, where X is
 (abs(a))  The absolute line number
 ;         And suppress all newlines and tabs after this too
           A closing ` to this code literal is auto added by QBIC at EOF
           Two closing NEXT statements are also auto-added.

Sample output
Just because I really like the pattern. Note that this took some fiddling in QBasic because the usual terminal output is limited to 80 chars and it wraps.
1        2        3        4        5        6        7        8        9        0
1       2       3       4       5       6       7       8       9       0
1      2      3      4      5      6      7      8      9      0
1     2     3     4     5     6     7     8     9     0
1    2    3    4    5    6    7    8    9    0
1   2   3   4   5   6   7   8   9   0
1  2  3  4  5  6  7  8  9  0
1 2 3 4 5 6 7 8 9 0
1234567890
1 2 3 4 5 6 7 8 9 0
1  2  3  4  5  6  7  8  9  0
1   2   3   4   5   6   7   8   9   0
1    2    3    4    5    6    7    8    9    0
1     2     3     4     5     6     7     8     9     0
1      2      3      4      5      6      7      8      9      0
1       2       3       4       5       6       7       8       9       0
1        2        3        4        5        6        7        8        9        0

J, 25 22 bytes
(1 j.|i:8)#"{1|.Num_j_

Try it online!

PHP, 76 Bytes
Update: Thanks to Soaku for the addition.
for($i=-9;$i++<8;)echo join(str_repeat(' ',abs($i)),range(1,9)+[9=>0])."
";

Try it online !
PHP, 88, 86, 80
Thanks to Caird for suggesting the golfing tips.
for($i=-9;$i++<8;)echo join(str_repeat(' ',abs($i)),[1,2,3,4,5,6,7,8,9,0])."\r";

You can try it here!

Welcome to the site, and be sure to check these tips for golfing in PHP!

Sorry so late, but I golfed it down to 76 bytes

str_pad("",abs($i)) is four bytes shorter than str_repeat(' ',abs($i)).

Perl 6, 43 37 35 bytes
Originally, I came to:
map({say join " "x abs($_-8),1..9,0},0..16)

The say function in perl 6 automatically adds a newline, and it's map works a bit different from perl 5, requiring less parens due to it's more list based approach.
Try it online
Fortunately, Jo King showed how to whittle it down further to 35 bytes:
{say join " "x.abs,1..9,0}for ^17-8

Try it online

0..16 => ^17

Or you can change to a list and use the list repetition operator for 37 bytes

Thanks, there's always more to learn :)
Interestingly, the code that runs on TIO perl6 does not run with rakudo, unless I change $++ to $_++

Huh. Well, here's 35 byter that uses a for loop

Too good! Thank you for sharing, I'm just starting to dabble with perl 6

Ah, I found the problem with $++ vs $_++, perl6 version 2013.12 built on parrot 5.9.0 revision 0, vs perl6 version 2015.11 built on MoarVM version 2015.11, where it behaves as on TIO.

R, 51 bytes
for(i in abs(-8:8))cat(1:9,0,"
",sep=strrep(" ",i))

Try it online!
Managed to find some more bytes thanks to JayCe's suggestion in the comments.

C, 135 128 characters
-7 characters thanks to kevin cruijssen
#define p printf
i=1,j,h=9,k;main(){for(;++i<22;i<10?h--:h++,p("\n"))for(j=0;++j<11;)for(p(j==10?"0":"%d",j),k=1;k++<h;)p(" ");}

Try it online!

Fun bonus:
On my first compile I got the logic backwards and ended up with the output in reverse
i=1,j,k,h=9;main(){for(;i++<20;){for(j=0;j++<10;){printf(j==10?"0":"%d",j);for(k=1;k++<10-h;){printf(" ");}}i<11?h--:h++;printf("\n");}}

Edit: removed missed whitespace

Welcome to PPCG! Great first answer.

Welcome to PPCG! This is indeed a great first answer, +1 from me. 7 bytes can be saved by removing all the brackets and putting everything inside the loop declarations: i=1,j,h=9,k;main(){for(;++i<22;i<10?h--:h++,p("\n"))for(j=0;++j<11;)for(p(j==10?"0":"%d",j),k=1;k++<h;)p(" ");} 128 bytes Enjoy your stay!

84 bytes by utilizing a single loop, print, and iteration variable, and switching to f() instead of main.

69 bytes building on @Rogem

Vyxal j, 15 bytes
8N8ṡȧƛð$ẋ9ʀ1Ǔ$j

Try it Online!
-1 byte thanks to Aaron Miller
8N                 -8
  8                 8
   ṡ                inclusive range; -8, -7, ..., 7, 8
    ȧ               abs; 8, 7, ..., 1, 0, 1, ..., 7, 8
     ƛ---------     for each
      ð$            push space and swap it underneath
        ẋ           repeat the space N times
         9ʀ         [0, 1, ..., 8, 9]
           1Ǔ       rotate left once
             $j     swap and join

j (flag)            join on newlines

15 bytes because structures auto-complete

@AaronMiller oh right, that's why i was using the j flag

13 bytes

Dash*, 69 bytes
seq -- -8 8|xargs -I: sh -c 'seq -s"`printf "%:s_"`" 10'|sed s/_1*//g

Hopefully this iteration is fairly self explanatory -- pretty much a straight swap of for to xargs.
Try it online!
Dash*, 87, 86, 73 bytes
for p in `seq -- -8 8`;do seq -s"`printf "%${p}s_"`" 10;done|sed s/_1*//g

Try it online!
Explanation (for method)
for p in `seq -- -8 8`

Produce -8 to 8, used to create separator in next seq.
NB BusyBox’s* seq barfs on the -8 without the -- but TIO’s Dash env does not.
;do seq -s"`printf "%${p}s_"`" 10

Print 1-10, separated with p × spaces, with an extra _ appended (because seq won't accept an empty separator).
;done|sed s/_1*//g

Remove the _ as well as the 1 from trailing 10.
EDIT: removed a silly space (thanks Kevin Cruijssen)
EDIT: saved many bytes because negative padding printf doesn't matter
EDIT: scraped off another few bytes by ditching the for in favour of xargs.
*Actually this is aimed at Busybox 1.31.1 ash, sed, seq and printf, but TIO didn't have that environment.  NB available seq options are limited to -w and -s.

Welcome to Code Golf, and nice first answer! Be sure to check out our Tips for golfing in Bash page for ways you can golf your program (they're likely to be applicable to Dash as well)

Nice first answer, welcome to CGCC! I think you can remove the space between 10 ;?

Not sure how that sneaked in there, thanks @KevinCruijssen

q/kdb+, 37 bytes
Solution:
-1" "{raze(1_11#.Q.n),\:y#x}'8-(!)17;

Example:
q)-1" "{raze(1_11#.Q.n),\:y#x}'8-(!)17;
1        2        3        4        5        6        7        8        9        0
1       2       3       4       5       6       7       8       9       0
1      2      3      4      5      6      7      8      9      0
1     2     3     4     5     6     7     8     9     0
1    2    3    4    5    6    7    8    9    0
1   2   3   4   5   6   7   8   9   0
1  2  3  4  5  6  7  8  9  0
1 2 3 4 5 6 7 8 9 0
1234567890
1 2 3 4 5 6 7 8 9 0
1  2  3  4  5  6  7  8  9  0
1   2   3   4   5   6   7   8   9   0
1    2    3    4    5    6    7    8    9    0
1     2     3     4     5     6     7     8     9     0
1      2      3      4      5      6      7      8      9      0
1       2       3       4       5       6       7       8       9       0
1        2        3        4        5        6        7        8        9        0

Explanation:
q is evaluation right-to-left. Here we are taking the range of -8..0..8, and joining that many spaces with the list "1234567890". We then use -1 to print out to stdout (rather than returning the list of strings).
-1 " "{raze (1_11#.Q.n),\:y#x}'8 - til 17; / ungolfed solution
                                   til 17  / range of 0..16
                               8 -         / take 8 from each value, gives -8..0..8
   " "{                      }'            / each left/right, passes in " " and then -8, -7, etc..
                          y#x              / take from list " ", note: negatives take from 'back' of list
                       ,\:                 / \: is 'each left', , means concatenate with, so take each left and concatenate with the right
            (1_11#.Q.n)                    / 'the left'. .Q.n is range 0-9 as a string, take 11 to get 0123..90, then drop the first
       raze                                / reduce down output list into a single string
-1                                       ; / print to stdout and swallow return value (-1)

Notes:
Doing (1_11#.Q.n) is 1 byte shorter than the much more straightforward "1234567890"... but as .Q.n returns "0123456789" some manipulation is required.

Ruby 2.4, 40 bytes
-8.upto 8{|i|puts [*1..9,0]*(' '*i.abs)}

Ruby (lower than 2.4), 41 bytes
-8.upto(8){|i|puts [*1..9,0]*(' '*i.abs)}

Try it online!

PHP, 71 bytes
while($y<17)echo chunk_split(1234567890,1,str_pad("",abs($y++-8))),"
";

Run with -nr or test it online.

Inspired by your solution, I got my solution down to 66: while($i<17)echo implode(str_pad('',abs($i++-8)),range(1,9))."\n";

Oops! Looks like I made an incorrect assumption about the output. I thought it was 123456789

Swift 3.1, 186 182 bytes
func f(_ n:Int=0,_ u:Bool=true){let p={if n<8{f(n+1,u)}};let q={print((1...9).map{String($0)+String(repeating:" ",count:n)}.joined()+"0")};if u{q();p()}else{p();q()}};f(1,false);f()

Explanation
func f(_ n:Int=0,_ u:Bool=true){          function (recursive) that does
                                          all the heavy-lifting =)
                                          n - number of spaces,
                                          u - go "up" or "down
let p={if n<8 {f(n+1,u)}}                 closure that runs f on higher step if can
let q={                                   closure which does the printing
print((1...9).map{                        print closed range of number mapped...
String($0)+String(repeating:" ",count:n)  ...making String from each number in range
                                          and appending n spaces to it
.joined()+"0")                            join all "1    "-like strings and append "0"
if u{q();p()}                             if go "up" - then call f before printing
else{p();q()}                             if go "down - the other way
f(1,false);f()                            run "up" then "down"

Removed some silly spaces. Thanx to Kevin Cruijssen

I feel there is a room for an improvement, though

I've never programmed in Swift, so perhaps I'm saying something stupid here, but is it possible to remove some of those spaces? Like the one here: n<8 {f(n+1; here: count:n) }; here: p()} else{p(); and/or here q()}}; f(1,false?

171 bytes

Bubblegum, 140 bytes
:P
0000000: ad92 510e c230 0c43 ff39 0547 802c f3bc  ..Q..0.C.9.G.,..
0000010: fb5f 8c10 c5d1 5a09 10b0 7d59 b1fd b4b6  ._....Z...}Y....
0000020: b95f eb33 8945 c225 5609 486c 1294 d825  ._.3.E.%V.Hl...%
0000030: 6e17 216d 02fa 84c3 04a3 5033 c906 8e0f  n.!m......P3....
0000040: 140c 0c8a 3000 ec50 f743 1987 2abb d83d  ....0..P.C..*..=
0000050: eb96 7707 dda0 f215 b70a 7b45 5141 66ac  ..w.......{EQAf.
0000060: 5296 19cf 04d2 67ba 4fd3 c2f2 3010 63c6  R.....g.O...0.c.
0000070: 3066 b6f8 8a8d fb0b fb0d eff3 2f7d 77ce  0f........../}w.
0000080: 1faf f3df 773c 7fa5 cedf f707            ....w<......

Try it online!
Do I get brownie points for having ._. two times in the dump?

131 bytes

How did I get out-golfed in Bubblegum? o0 What compression method did you use?

I used zopfli to generate a DEFLATE stream. I got to 130 bytes with 222 iterations.

For some reason the byte count went up with more then 314 iterations. zopfli link

V, 18 bytes
¬19á08ñÄÓä/&
YGpH

Try it online!

Cubically, 2622 bytes
U3D1R3L1F3B1U1D3+3111111@6-2111@66666666+21111@6-21111@66666666+211111@6-211111@66666666+0@6-0@66666666+01@6-01@66666666+011@6-011@66666666+0111@6-0111@66666666+4@6-4@66666666+41@6-41@66666666+211@6-511111@6+5111111@6-2111@6666666+21111@6-21111@6666666+211111@6-211111@6666666+0@6-0@6666666+01@6-01@6666666+011@6-011@6666666+0111@6-0111@6666666+4@6-4@6666666+41@6-41@6666666+211@6-511111@6+5111111@6-2111@666666+21111@6-21111@666666+211111@6-211111@666666+0@6-0@666666+01@6-01@666666+011@6-011@666666+0111@6-0111@666666+4@6-4@666666+41@6-41@666666+211@6-511111@6+5111111@6-2111@66666+21111@6-21111@66666+211111@6-211111@66666+0@6-0@66666+01@6-01@66666+011@6-011@66666+0111@6-0111@66666+4@6-4@66666+41@6-41@66666+211@6-511111@6+5111111@6-2111@6666+21111@6-21111@6666+211111@6-211111@6666+0@6-0@6666+01@6-01@6666+011@6-011@6666+0111@6-0111@6666+4@6-4@6666+41@6-41@6666+211@6-511111@6+5111111@6-2111@666+21111@6-21111@666+211111@6-211111@666+0@6-0@666+01@6-01@666+011@6-011@666+0111@6-0111@666+4@6-4@666+41@6-41@666+211@6-511111@6+5111111@6-2111@66+21111@6-21111@66+211111@6-211111@66+0@6-0@66+01@6-01@66+011@6-011@66+0111@6-0111@66+4@6-4@66+41@6-41@66+211@6-511111@6+5111111@6-2111@6+21111@6-21111@6+211111@6-211111@6+0@6-0@6+01@6-01@6+011@6-011@6+0111@6-0111@6+4@6-4@6+41@6-41@6+211@6-511111@6+5111111@6+1@6+1@6+1@6+1@6+1@6+1@6+1@6+1@6-111111111@6-511111@6+5111111@6-2111@6+21111@6-21111@6+211111@6-211111@6+0@6-0@6+01@6-01@6+011@6-011@6+0111@6-0111@6+4@6-4@6+41@6-41@6+211@6-511111@6+5111111@6-2111@66+21111@6-21111@66+211111@6-211111@66+0@6-0@66+01@6-01@66+011@6-011@66+0111@6-0111@66+4@6-4@66+41@6-41@66+211@6-511111@6+5111111@6-2111@666+21111@6-21111@666+211111@6-211111@666+0@6-0@666+01@6-01@666+011@6-011@666+0111@6-0111@666+4@6-4@666+41@6-41@666+211@6-511111@6+5111111@6-2111@6666+21111@6-21111@6666+211111@6-211111@6666+0@6-0@6666+01@6-01@6666+011@6-011@6666+0111@6-0111@6666+4@6-4@6666+41@6-41@6666+211@6-511111@6+5111111@6-2111@66666+21111@6-21111@66666+211111@6-211111@66666+0@6-0@66666+01@6-01@66666+011@6-011@66666+0111@6-0111@66666+4@6-4@66666+41@6-41@66666+211@6-511111@6+5111111@6-2111@666666+21111@6-21111@666666+211111@6-211111@666666+0@6-0@666666+01@6-01@666666+011@6-011@666666+0111@6-0111@666666+4@6-4@666666+41@6-41@666666+211@6-511111@6+5111111@6-2111@6666666+21111@6-21111@6666666+211111@6-211111@6666666+0@6-0@6666666+01@6-01@6666666+011@6-011@6666666+0111@6-0111@6666666+4@6-4@6666666+41@6-41@6666666+211@6-511111@6+5111111@6-2111@66666666+21111@6-21111@66666666+211111@6-211111@66666666+0@6-0@66666666+01@6-01@66666666+011@6-011@66666666+0111@6-0111@66666666+4@6-4@66666666+41@6-41@66666666+211@6

Pretty simple, turns the cube to get it into this:
   242
   202
   242
000131555313
010121535343
000131555313
   424
   454
   424

Now the LEFT face sums up to 1. So we use the other faces to get as close to the desired ASCII values as possible, then just increment/decrement by 1.
This also works:
Cubically, 2938 bytes
:4/1+5@6/1+3@66666666+2@6-2@66666666:5+1/1+5@6/1+3@66666666:5+2/1+5@6/1+3@66666666:5+3/1+5@6/1+3@66666666:5+1@6:5/1+3@66666666:1/1+51@6:5/1+3@66666666:2/1+51@6:5/1+3@66666666/1+51@6:5/1+3@66666666/1+5@6:1/1+1@6:4/1+5@6/1+3@6666666+2@6-2@6666666:5+1/1+5@6/1+3@6666666:5+2/1+5@6/1+3@6666666:5+3/1+5@6/1+3@6666666:5+1@6:5/1+3@6666666:1/1+51@6:5/1+3@6666666:2/1+51@6:5/1+3@6666666/1+51@6:5/1+3@6666666/1+5@6:1/1+1@6:4/1+5@6/1+3@666666+2@6-2@666666:5+1/1+5@6/1+3@666666:5+2/1+5@6/1+3@666666:5+3/1+5@6/1+3@666666:5+1@6:5/1+3@666666:1/1+51@6:5/1+3@666666:2/1+51@6:5/1+3@666666/1+51@6:5/1+3@666666/1+5@6:1/1+1@6:4/1+5@6/1+3@66666+2@6-2@66666:5+1/1+5@6/1+3@66666:5+2/1+5@6/1+3@66666:5+3/1+5@6/1+3@66666:5+1@6:5/1+3@66666:1/1+51@6:5/1+3@66666:2/1+51@6:5/1+3@66666/1+51@6:5/1+3@66666/1+5@6:1/1+1@6:4/1+5@6/1+3@6666+2@6-2@6666:5+1/1+5@6/1+3@6666:5+2/1+5@6/1+3@6666:5+3/1+5@6/1+3@6666:5+1@6:5/1+3@6666:1/1+51@6:5/1+3@6666:2/1+51@6:5/1+3@6666/1+51@6:5/1+3@6666/1+5@6:1/1+1@6:4/1+5@6/1+3@666+2@6-2@666:5+1/1+5@6/1+3@666:5+2/1+5@6/1+3@666:5+3/1+5@6/1+3@666:5+1@6:5/1+3@666:1/1+51@6:5/1+3@666:2/1+51@6:5/1+3@666/1+51@6:5/1+3@666/1+5@6:1/1+1@6:4/1+5@6/1+3@66+2@6-2@66:5+1/1+5@6/1+3@66:5+2/1+5@6/1+3@66:5+3/1+5@6/1+3@66:5+1@6:5/1+3@66:1/1+51@6:5/1+3@66:2/1+51@6:5/1+3@66/1+51@6:5/1+3@66/1+5@6:1/1+1@6:4/1+5@6/1+3@6+2@6-2@6:5+1/1+5@6/1+3@6:5+2/1+5@6/1+3@6:5+3/1+5@6/1+3@6:5+1@6:5/1+3@6:1/1+51@6:5/1+3@6:2/1+51@6:5/1+3@6/1+51@6:5/1+3@6/1+5@6:1/1+1@6:4/1+5@6/1+5@6:5+1/1+5@6:5+2/1+5@6:5+3/1+5@6:5+1@6:1/1+51@6:2/1+51@6:3/1+51@6-1@6:1/1+1@6:4/1+5@6/1+3@6+2@6-2@6:5+1/1+5@6/1+3@6:5+2/1+5@6/1+3@6:5+3/1+5@6/1+3@6:5+1@6:5/1+3@6:1/1+51@6:5/1+3@6:2/1+51@6:5/1+3@6/1+51@6:5/1+3@6/1+5@6:1/1+1@6:4/1+5@6/1+3@66+2@6-2@66:5+1/1+5@6/1+3@66:5+2/1+5@6/1+3@66:5+3/1+5@6/1+3@66:5+1@6:5/1+3@66:1/1+51@6:5/1+3@66:2/1+51@6:5/1+3@66/1+51@6:5/1+3@66/1+5@6:1/1+1@6:4/1+5@6/1+3@666+2@6-2@666:5+1/1+5@6/1+3@666:5+2/1+5@6/1+3@666:5+3/1+5@6/1+3@666:5+1@6:5/1+3@666:1/1+51@6:5/1+3@666:2/1+51@6:5/1+3@666/1+51@6:5/1+3@666/1+5@6:1/1+1@6:4/1+5@6/1+3@6666+2@6-2@6666:5+1/1+5@6/1+3@6666:5+2/1+5@6/1+3@6666:5+3/1+5@6/1+3@6666:5+1@6:5/1+3@6666:1/1+51@6:5/1+3@6666:2/1+51@6:5/1+3@6666/1+51@6:5/1+3@6666/1+5@6:1/1+1@6:4/1+5@6/1+3@66666+2@6-2@66666:5+1/1+5@6/1+3@66666:5+2/1+5@6/1+3@66666:5+3/1+5@6/1+3@66666:5+1@6:5/1+3@66666:1/1+51@6:5/1+3@66666:2/1+51@6:5/1+3@66666/1+51@6:5/1+3@66666/1+5@6:1/1+1@6:4/1+5@6/1+3@666666+2@6-2@666666:5+1/1+5@6/1+3@666666:5+2/1+5@6/1+3@666666:5+3/1+5@6/1+3@666666:5+1@6:5/1+3@666666:1/1+51@6:5/1+3@666666:2/1+51@6:5/1+3@666666/1+51@6:5/1+3@666666/1+5@6:1/1+1@6:4/1+5@6/1+3@6666666+2@6-2@6666666:5+1/1+5@6/1+3@6666666:5+2/1+5@6/1+3@6666666:5+3/1+5@6/1+3@6666666:5+1@6:5/1+3@6666666:1/1+51@6:5/1+3@6666666:2/1+51@6:5/1+3@6666666/1+51@6:5/1+3@6666666/1+5@6:1/1+1@6:4/1+5@6/1+3@66666666+2@6-2@66666666:5+1/1+5@6/1+3@66666666:5+2/1+5@6/1+3@66666666:5+3/1+5@6/1+3@66666666:5+1@6:5/1+3@66666666:1/1+51@6:5/1+3@66666666:2/1+51@6:5/1+3@66666666/1+51@6:5/1+3@66666666/1+5@6

Uses the existing cube and division to get the required ASCII values.
Found using these answers.

Zsh, 48 bytes
for 1 ({9..1} {2..9})printf %-$1s {1..9} 0&&echo

Try it Online!
49b 61b 57b
Similar to Spaceship Maw!. -4, -8 bytes thanks to @pxeger.

57: Try it online!

49: Try it online!

Deadfish~, 2959 bytes
{iiiii}dc{dd}iiicccccccc{ii}ddc{dd}iicccccccc{ii}dc{dd}icccccccc{ii}c{dd}cccccccc{ii}ic{dd}dcccccccc{ii}iic{dd}ddcccccccc{ii}iiic{dd}dddcccccccc{ii}iiiic{dd}ddddcccccccc{ii}iiiiic{dd}dddddcccccccc{i}iiiiiic{dddd}iic{iiii}dc{dd}iiiccccccc{ii}ddc{dd}iiccccccc{ii}dc{dd}iccccccc{ii}c{dd}ccccccc{ii}ic{dd}dccccccc{ii}iic{dd}ddccccccc{ii}iiic{dd}dddccccccc{ii}iiiic{dd}ddddccccccc{ii}iiiiic{dd}dddddccccccc{i}iiiiiic{dddd}iic{iiii}dc{dd}iiicccccc{ii}ddc{dd}iicccccc{ii}dc{dd}icccccc{ii}c{dd}cccccc{ii}ic{dd}dcccccc{ii}iic{dd}ddcccccc{ii}iiic{dd}dddcccccc{ii}iiiic{dd}ddddcccccc{ii}iiiiic{dd}dddddcccccc{i}iiiiiic{dddd}iic{iiii}dc{dd}iiiccccc{ii}ddc{dd}iiccccc{ii}dc{dd}iccccc{ii}c{dd}ccccc{ii}ic{dd}dccccc{ii}iic{dd}ddccccc{ii}iiic{dd}dddccccc{ii}iiiic{dd}ddddccccc{ii}iiiiic{dd}dddddccccc{i}iiiiiic{dddd}iic{iiii}dc{dd}iiicccc{ii}ddc{dd}iicccc{ii}dc{dd}icccc{ii}c{dd}cccc{ii}ic{dd}dcccc{ii}iic{dd}ddcccc{ii}iiic{dd}dddcccc{ii}iiiic{dd}ddddcccc{ii}iiiiic{dd}dddddcccc{i}iiiiiic{dddd}iic{iiii}dc{dd}iiiccc{ii}ddc{dd}iiccc{ii}dc{dd}iccc{ii}c{dd}ccc{ii}ic{dd}dccc{ii}iic{dd}ddccc{ii}iiic{dd}dddccc{ii}iiiic{dd}ddddccc{ii}iiiiic{dd}dddddccc{i}iiiiiic{dddd}iic{iiii}dc{dd}iiicc{ii}ddc{dd}iicc{ii}dc{dd}icc{ii}c{dd}cc{ii}ic{dd}dcc{ii}iic{dd}ddcc{ii}iiic{dd}dddcc{ii}iiiic{dd}ddddcc{ii}iiiiic{dd}dddddcc{i}iiiiiic{dddd}iic{iiii}dc{dd}iiic{ii}ddc{dd}iic{ii}dc{dd}ic{ii}c{dd}c{ii}ic{dd}dc{ii}iic{dd}ddc{ii}iiic{dd}dddc{ii}iiiic{dd}ddddc{ii}iiiiic{dd}dddddc{i}iiiiiic{dddd}iic{iiii}dcicicicicicicicic{d}ic{dddd}iic{iiii}dc{dd}iiic{ii}ddc{dd}iic{ii}dc{dd}ic{ii}c{dd}c{ii}ic{dd}dc{ii}iic{dd}ddc{ii}iiic{dd}dddc{ii}iiiic{dd}ddddc{ii}iiiiic{dd}dddddc{i}iiiiiic{dddd}iic{iiii}dc{dd}iiicc{ii}ddc{dd}iicc{ii}dc{dd}icc{ii}c{dd}cc{ii}ic{dd}dcc{ii}iic{dd}ddcc{ii}iiic{dd}dddcc{ii}iiiic{dd}ddddcc{ii}iiiiic{dd}dddddcc{i}iiiiiic{dddd}iic{iiii}dc{dd}iiiccc{ii}ddc{dd}iiccc{ii}dc{dd}iccc{ii}c{dd}ccc{ii}ic{dd}dccc{ii}iic{dd}ddccc{ii}iiic{dd}dddccc{ii}iiiic{dd}ddddccc{ii}iiiiic{dd}dddddccc{i}iiiiiic{dddd}iic{iiii}dc{dd}iiicccc{ii}ddc{dd}iicccc{ii}dc{dd}icccc{ii}c{dd}cccc{ii}ic{dd}dcccc{ii}iic{dd}ddcccc{ii}iiic{dd}dddcccc{ii}iiiic{dd}ddddcccc{ii}iiiiic{dd}dddddcccc{i}iiiiiic{dddd}iic{iiii}dc{dd}iiiccccc{ii}ddc{dd}iiccccc{ii}dc{dd}iccccc{ii}c{dd}ccccc{ii}ic{dd}dccccc{ii}iic{dd}ddccccc{ii}iiic{dd}dddccccc{ii}iiiic{dd}ddddccccc{ii}iiiiic{dd}dddddccccc{i}iiiiiic{dddd}iic{iiii}dc{dd}iiicccccc{ii}ddc{dd}iicccccc{ii}dc{dd}icccccc{ii}c{dd}cccccc{ii}ic{dd}dcccccc{ii}iic{dd}ddcccccc{ii}iiic{dd}dddcccccc{ii}iiiic{dd}ddddcccccc{ii}iiiiic{dd}dddddcccccc{i}iiiiiic{dddd}iic{iiii}dc{dd}iiiccccccc{ii}ddc{dd}iiccccccc{ii}dc{dd}iccccccc{ii}c{dd}ccccccc{ii}ic{dd}dccccccc{ii}iic{dd}ddccccccc{ii}iiic{dd}dddccccccc{ii}iiiic{dd}ddddccccccc{ii}iiiiic{dd}dddddccccccc{i}iiiiiic{dddd}iic{iiii}dc{dd}iiicccccccc{ii}ddc{dd}iicccccccc{ii}dc{dd}icccccccc{ii}c{dd}cccccccc{ii}ic{dd}dcccccccc{ii}iic{dd}ddcccccccc{ii}iiic{dd}dddcccccccc{ii}iiiic{dd}ddddcccccccc{ii}iiiiic{dd}dddddcccccccc{i}iiiiiic{dddd}iic

Excel, 74 bytes
=LET(x,MOD(COLUMN(A:J),10),CONCAT(x&IF(x,REPT(" ",ABS(ROW(1:17)-9)),"
")))

Link to Spreadsheet
The version without LET that would have been valid when the question was asked is only 2 bytes longer.
Without LET, 76 bytes
=CONCAT(RIGHT(COLUMN(A:J))&IF(COLUMN(A:J)>9,"
",REPT(" ",ABS(ROW(1:17)-9))))

Vyxal j, 11 bytes
8ʀṘ∞ƛ9ʀǓ$Ij

Try it Online!
8ʀṘ∞ƛ9ʀǓ$Ij
8ʀ          # Range [0, 8]
  Ṙ         # Reverse
   ∞        # Palindromise, append reverse without first element.
            # Produces [8, 7, 6, ..., 1, 0, 1, 2, ..., 7, 8]
    ƛ       # For each:
     9ʀ     # Range [0, 9]
       Ǔ    # Rotate it left to make [1,2,3,4,5,6,7,8,9,0]
        $   # Swap so the current element is at the top
         I  # Push that many spaces
          j # Join the number list by these spaces
            # j flag joins on newlines

Thunno 2 N, 11 bytes
9LrⱮıṣkDỤsj

Try it online!
Explanation
9LrⱮıṣkDỤsj  # Implicit input
9L           # Push [0..9)
  r          # Reverse it
   Ɱ         # And palindromise that
    ı        # Map over this list:
     ṣ       #  Push that many spaces
      kDỤ    #  Push "1234567890"
         sj  #  Join it by the spaces
             # Join on newlines
             # Implicit output

Swift 5.9, 106 bytes
for i in(1..<9)+(1...9).reversed(){(1...10).map{print($0%10,terminator:{String.init}()(" ",9-i))};print()}

Cheddar, 42 bytes
-8|>8=>n->print(1|>9+[0]).join(abs(n)*' ')

Try it online!

Sink, 102 100 bytes
var v=range 0,17
var p=list.push(range 0,10),0
for var s:v
say list.join p,str.pad"",num.abs s-8
end

Try it online! (sort of, it's just a repl so you'll need to type it in)
-2 bytes thanks to @Kevin Cruijssen

Welcome to PPCG! Nice first answer, +1 from me. I've never even heard of Sink before, so it's always great to see a new programming language. Btw, I tried some things in the REPL, and if I'm not mistaken you can golf two spaces on this line: say list.join p,str.pad"",num.abs s-8. Again welcome, and enjoy your stay. :)

Delphi / Pascal  137 Bytes*
program x;{$APPTYPE CONSOLE}var i,j: Integer;begin for i:=-8 to 8do begin write(#10,1); for j:=2 to 10do Write(j mod 10:Abs(i)+1);end;end.

*The {$APPTYPE CONSOLE} is a compiler directive that can be removed for pure Pascal. or if compiled with the Delphi command line compiler using the -cc switch to give 119 bytes. Without it you get a runtime error as it tries to print to a non existent console.

[Java 7],  137 132 bytes
Saved 3 bytes thanx to Kevin Cruijssen and 2 more thanx to  TheLethalCoder
void a(){int i,j,k;for(i=-8;i<9;i++){String a="";for(j=1;j<11;j++){a+=j%10;for(k=0;k<(i<0?-i:i);k++)a+=" ";}System.out.println(a);}}

 void a(){for(int i=-8;i<9;i++){String a="";for(int j=1;j<11;j++){a+=j%10;for(int k=0;k<Math.abs(i);k++){a+=" ";}}System.out.println(a);}}

Ungolfed:
  void a(){
    int i,j,k;
    for(i=-8;i<9;i++){
        String a="";
        for(j=1;j<11;j++){
            a+=j%10;
            for(k=0;k<(i<0?-i:i);k++)a+=" ";
        }
        System.out.println(a);
    }
}

Declare i, j, and k in one place to save bytes (I'm sure you go do this in Java). Use Java 8 and compile to an anonymous method. I think int i=-9;++i<9;i should work and similar for j and k. I'm not sure if Math needs qualifying but I don't know Java well enough to say for sure. I think you can remove the braces from the k loop as well.

Also it might be cheaper, especially when compiling to a lambda, to return the results as a string.

Welcome to PPCG! There is already a shorter Java answer posted, but that doesn't matter because it uses a different approach. But, you can still shorten your code a bit like this: void a(){for(int i=-8,j,k;i<9;i++){String a="";for(j=1;j<11;)for(a+=j++%10,k=0;k++<(i<0?-i:i);)a+=" ";System.out.println(a);}}. (I've put some things inside the for-loop to get rid of the brackets; I've removed the two int by adding ,j,k in the first loop; and I've changed Math.abs(i) to (i<0?-i:i). It might also be useful to read Tips for golfing in Java. :) Enjoy your stay.

tcl, 112
Very naïve:
proc x n\ s {time {puts [join {1 2 3 4 5 6 7 8 9 0} [format %[incr n $s]s \ ]]} 9}
x 10 -1
puts 1234567890
x 0 1

demo

Different approach with same size http://rextester.com/RGO50353

/// (Slashes), 377 374 bytes
/a/1_//b/2_//c/3_//d/4_//e/5_//f/6_//g/7_//h/8_//i/9_//z/0
//./  //-/. //_/../a_b_c_d_e_f_g_h_i_za-b-c-d-e-f-g-h-i-za.b.c.d.e.f.g.h.i.za b c d e f g h i zabcdefghiz1-2-3-4-5-6-7-8-9-z1.2.3.4.5.6.7.8.9.z1 2 3 4 5 6 7 8 9 z123456789z1 2 3 4 5 6 7 8 9 z1.2.3.4.5.6.7.h.9.z1-2-3-4-5-6-7-8-9-zabcdefghiza b c d e f g h i za.b.c.d.e.f.g.h.i.za-b-c-d-e-f-g-h-i-za_b_c_d_e_f_g_h_i_0

Try it online!
Explanation
The original output was initially compressed by doing the following replacements:

     (4 spaces) → _
    (3 spaces) → -
   (2 spaces) → .

In a second step, 1_ was replaced by a, 2_ by b and so on. Finally, those mappings were inverted and prepended to the code.
Additional step (thx to CalculatorFeline):
/./  //-/   //_/    / → /_/..//-/. //./  /

/./  //-/   //_/    / can be /_/..//-/. //./  /. Imagine the spaces being correct because Markdown doesn't like multiple spaces in inline code blocks >:(

@CalculatorFeline Thanks, missed that one. Btw, you can fake the spaces with "figure space" (U+2007), markdown doesn't seem to collapse those (it's what I did in the post as well).

C#, 131 bytes
My first participation
for(int i=8;i>-9;i--){for(int n=1;n<=10;n++){Console.Write((n==10?"0":n.ToString())+new String(' ',Math.Abs(i))+(n==10?"\n":""));}}

More easy reading version
for (int i = 8; i > -9; i--)
{
    for (int n = 1; n <= 10; n++)
    {
        Console.Write((n==10 ? "0" : n.ToString()) + new String(' ', Math.Abs(i)) + (n == 10 ? "\n" : ""));
    }
}

Welcome to PPCG.SE! A nice first post though by default, you should supply a full program or function, not just a snippet like you have here. See this meta post for more. I would also recommend you have a look at Try it Online which lets you run your code online and share it with others. It can also format your answers for you to post here.

Welcome to PPCG! In addition to what @Notts90 said, I can also recommend reading Tips for golfing in C# and Tips for golfing in . Some things you can golf is removing the brackets and int; change the condition to remove the =; and change the Math.abs, like this: o=>{for(int i=8,n;i>-9;i--)for(n=1;n<11;n++)Console.Write((n>9?0:n)+new String(' ',i<0?-i:i)+(n>9?"\n":""));} (where o=> is an unused parameter). Try it here. Again welcome, and enjoy your stay. :)

Oh, and one more thing after my previous golfed version: o=>{for(int i=8,n;i>-9;i--)for(n=1;n<11;)Console.Write((n>9?0:n)+new String(' ',i<0?-i:i)+(n++>9?"\n":""));} (the n++ is removed and ++ is added to the last n. Try it here. So 108 bytes in total.

Thanks for the comments Notts90 and Kevin, I will look at your code this evening :)

Stacked, 33 bytes
9:>' '*[9~>\#`]"!:8~>#rev\,$out"!

Try it online!
Explanation
9:>' '*[9~>\#`]"!:8~>#rev\,$out"!
9:>                                 range from 0 to 9 (right-exclusive)
   ' '*                             vectorized repetition of the space
       [      ]"!                   on each repetition:
        9~>                           generate a range from 1 to 9
           \#`                        and join it by that repetition
                 :8~>#              copy all but the first element
                      rev           reverse it
                         \,         swap then concatenate
                           $out"!   output each

///, 251 bytes
/B/' //A/!!//@/" //?/\/\///>/  ?=/0
1?</ 2 3 4 5 6 7 8 9 ?;/!2!3!4!5!6!7!8!9!?:/'2'3'4'5'6'7'8'9'?-/="2"3"4"5"6"7"8"9"=?,/@2@3@4@5@6@7@8@9@?'/!"?&/=>2>3>4>5>6>7>8>9>=?%/=A2A3A4A5A6A7A8A9A=?#/1B2B3B4B5B6B7B8B9B0?"/! ?!/> /#
1:%,-;&<=23456789=<&;-,%:0
#

Try it online! Or here, interactively!
Considerably long, but /// has no real way of modifying data elegantly.

Lua, 106 85 bytes
-21 bytes thanks to user202729
n="1L2L3L4L5L6L7L8L9L0"for i=-8,8,1 do print((n:gsub("L",(" "):rep(math.abs(i)))))end

Output has a trailing newline
Ungolfed
n="1L2L3L4L5L6L7L8L9L0"
for i=-8,8,1 do
    print((n:gsub("L",(" "):rep(math.abs(i)))))
end

Try It Online

Hi there. Would you mind adding a TIO-link with test code? Lua should be available on TIO as well.

You can save 5 bytes by using (" "):rep.

You can also get it down to 82 bytes with pattern. Hint: %1.

brainfuck, 209 bytes
++++++++[->+>+>+>++++>++++++>+>>+<<<<<<<<]>++>+>+>>>>>+<<<<<<-[->>>>>>[-<<<+.>[-<<.>>>+<]>[-<+>]>>+<]>[-<+<<<->>>>]<<<-<.<<<<.>]>[->>>>>[-<<<+.>>>>>[->+<<<<<<<.>>>>>>]>[-<+>]<<+<]>[-<+<<<->>>>]>+<<<<<.<<<<.>>]

Try it online!
I noticed there wasn’t a brainfuck submission yet, so I gave it my best shot. Definitely not the most golfed solution possible, but I’m not upset with the result.

Canvas, 20 15 bytes
９｛９∔ ×９Ｒ0∔∑；＊］─

Try it here!
Explanation:
９｛９∔ ×９Ｒ0∔∑；＊］─  | (Full code)
                        | Print (implicit)
    ９∔ ×               | 9-i spaces
         ９Ｒ0∔∑；＊    | Inserted between the characters of the string "1234567890"
９｛                    | For each i in [1-9]
                   ］   | Separated by newlines
                     ─  | Palindromized vertically with 1 line of overlap

VBA, 58 bytes

An immediate window function that takes no input and outputs to the console.
For i=-8To 8:For j=1To 9:?j &""Spc(Abs(i));:Next:?"0":Next

Ungolfed and Commented
For i=-8To 8        ''  Iterate `i` from `-8` to `8`
For j=1To 9         ''  Iterate `j` from `1` to `9`
?j &""Spc(Abs(i));  ''  Print `j` and `i` spaces
Next                ''  Loop `j`
?"0"                ''  Print `0`, with a newline
Next                ''  Loop `i`

QBasic, 66 bytes

An undeclared subroutine that takes no input and outputs to STDOUT
FOR i=-8TO 8
FOR j=49TO 57
?CHR$(j)SPC(ABS(i));
NEXT
?"0
NEXT

JavaScript, 71 bytes
f=(i=8,q=[..."1234567890"].join(" ".repeat(i)))=>i?q+`
`+f(i-1)+`
`+q:q

Elixir, 126 bytes
Enum.each 8..-8,fn n->IO.puts Enum.map Enum.into(1..10,[],&(rem &1,10)),&(Integer.to_string(&1)<>String.duplicate" ",abs n)end

Try it online!
Enum.each 8..-8,
          fn n->
            IO.puts
              Enum.map
                Enum.into(1..10, [], &(rem &1,10)),
                &(Integer.to_string(&1) <> String.duplicate" ",abs n)
          end

For each number in the range 8 to -8, do this anonymous function with the number as n. The function (inner to outer) sets the range 1 to 10 into a list after applying the remainder mod 10 (so we have the list 1,2,3,4,5,6,7,8,9,0). Then maps that list of numbers into strings, and concatenates the absolute value of n spaces onto the end. After getting each string we print out the whole list of strings... and Elixir doesn't put any delimiter on that by default.
Output:
1        2        3        4        5        6        7        8        9        0
1       2       3       4       5       6       7       8       9       0
1      2      3      4      5      6      7      8      9      0
1     2     3     4     5     6     7     8     9     0
1    2    3    4    5    6    7    8    9    0
1   2   3   4   5   6   7   8   9   0
1  2  3  4  5  6  7  8  9  0
1 2 3 4 5 6 7 8 9 0
1234567890
1 2 3 4 5 6 7 8 9 0
1  2  3  4  5  6  7  8  9  0
1   2   3   4   5   6   7   8   9   0
1    2    3    4    5    6    7    8    9    0
1     2     3     4     5     6     7     8     9     0
1      2      3      4      5      6      7      8      9      0
1       2       3       4       5       6       7       8       9       0
1        2        3        4        5        6        7        8        9        0

Pip -l, 18 16 bytes
(\,t)%tJsXPZRV,9

Try it online!
Explanation
                  t is 10, s is " " (implicit)
              ,9  Range(9): [0 1 2 3 4 5 6 7 8]
            RV    Reverse: [8 7 6 5 4 3 2 1 0]
          PZ      Palindromize: [8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8]
        sX        For each element of the above list, a string of that many spaces
 \,t              Inclusive-range(10): [1 2 3 4 5 6 7 8 9 10]
(   )%t           Mod 10: [1 2 3 4 5 6 7 8 9 0]
       J          For each string of spaces, join the above list on that string
                  Output the list of results one per line (`-l` flag)

The PZ operator was added more than a year after this challenge was posted, so here's a 17-byte answer that would have worked at that time:
(\,t)%tJsXAB:-8,9

Try it online!

Sisi, 239 bytes
0set s8
1set d0-1
2set o""
3set i1
4set o o+i
5jumpif i7
6jump17
7set x s
8jump11
9set o o+" "
10set x x-1
11jumpif x9
12set c9>i
13jumpif c15
14set i0-1
15set i1+i
16jump4
17print o
18set s s+d
19jumpif s21
20set d1
21set q9>s
22jumpif q2

Try it online!
The basic strategy is to run a loop from 8 down to 0 and back up to 8, constructing each line accordingly and printing it. I'm not going to write a detailed explanation, but if you're trying to follow the algorithm, the following key to the variable names may be helpful:

s: number of spaces to print between digits
d: direction of change in s (-1 or 1)
o: the current line of output
i: the current digit
x: loop counter while printing spaces
c: conditional that tests whether i is less than 9 (if not, we set it to -1 so it gets incremented to 0 instead of 10)
q: conditional that tests whether s is less than 9 (if so, we continue looping)

Hmm, never seen or heard about the programming language SIsi. Weird how those leading line numbering are mandatory. Nice answer though!

@KevinCruijssen Not surprised that you haven't heard of it--it's a toy language I wrote for an old popularity contest here. :)

///, 244 bytes
/*/\/\///X/0
1*j/\/X*x/  *S/x *s/SS*-/S *_/s *(/- *)/_ *A/)2)3)4)5)6)7)8)9)*Bj_2_3_4_5_6_7_8_9_*Cjs2s3s4s5s6s7s8s9s*Dj(2(3(4(5(6(7(8(9(*Ej-2-3-4-5-6-7-8-9-*FjS2S3S4S5S6S7S8S9S*Gjx2x3x4x5x6x7x8x9x*Hj 2 3 4 5 6 7 8 9 /1ABCDEFGHX23456789HGFEDCBXA0

Try it online!

Pushy, 27 bytes
Not the most elegant solution, but it does the job.
N9X@wL:Ocv:32;ZT:hT%#^"v;T'

Try it online!
Explanation:

N                                \ Set printing delimiter to empty string
 9X                              \ Push range(9) to stack: [0, 1, 2, 3, 4, 5, 6, 7, 8]
   @                             \ Reverse: [8, 7, 6, 5, 4, 3, 2, 1, 0]
    w                            \ Mirror: [8, 7, 6... 1, 0, 1... 6, 7, 8]
     L:                          \ Length (17) times do:
       Oc                        \   Go to (cleared) auxiliary stack
         v:                      \   Pop top of main stack, and that many times:
           32;                           Push character 32 (space)
              Z                  \   Push 0
               T                 \   Ten times do:
                :hT%             \      counter = (counter + 1) mod 10
                    #            \      Print the counter
                     ^"v;        \      Print the rest of the stack (spaces)
                         T'      \   Print a newline

Would you mind adding an explanation?

Tcl, 99 bytes
time {incr i;time {puts -nonewline [incr j][string repe " " [expr abs(9-$i)]]} 9;puts 0;unset j} 17

Try it online!

Rockstar, 127 126 124 bytes
-1 byte thanks to Kevin
F takes X
cut 1234567890 into L
join L with " "*X
say L

X's9
while X
let X be-1
F taking X

while X-8
let X be+1
F taking X

Try it here (Code will need to be pasted in)

Based on your other Rockstar answer the space can be removed at be-1, right?

Thanks, @KevinCruijssen. Dunno how that snuck in there; omitting that space is one of my favourite wee byte-saving tricks in Rockstar.

Stax, 12 bytes
ü¡↑├☼Rσ┬q▄└m

Run and debug it
can probably tie mathgolf. Port of Emigna's answer.

BRASCA, 72 bytes
8[a09Ir,m[oA:a[Eo{]x]xloA{]x09Ir,m[o]lo8[9$-a09Ir,m[oA:a[Eo{]x]xloA}9$-]

Try it online!

Deadfish~, 2606 bytes
ioi{iii}cccccccc{ddd}o{iii}ccccccccd{ii}ci{dd}cccccccc{ii}c{dd}cccccccci{ii}cd{dd}ccccccccii{ii}cdd{dd}ccccccccd{{{i}}}odsddddcccccccc{{{i}}}oddsddddcccccccci{ddd}soiii{ii}cccccccc{{d}}o{i}ci{d}oi{iii}ccccccc{ddd}o{iii}cccccccd{ii}ci{dd}ccccccc{ii}c{dd}ccccccci{ii}cd{dd}cccccccii{ii}cdd{dd}cccccccd{{{i}}}odsddddccccccc{{{i}}}oddsddddccccccci{ddd}soiii{ii}ccccccc{{d}}o{i}ci{d}oi{iii}cccccc{ddd}o{iii}ccccccd{ii}ci{dd}cccccc{ii}c{dd}cccccci{ii}cd{dd}ccccccii{ii}cdd{dd}ccccccd{{{i}}}odsddddcccccc{{{i}}}oddsddddcccccci{ddd}soiii{ii}cccccc{{d}}o{i}ci{d}oi{iii}ccccc{ddd}o{iii}cccccd{ii}ci{dd}ccccc{ii}c{dd}ccccci{ii}cd{dd}cccccii{ii}cdd{dd}cccccd{{{i}}}odsddddccccc{{{i}}}oddsddddccccci{ddd}soiii{ii}ccccc{{d}}o{i}ci{d}oi{iii}cccc{ddd}o{iii}ccccd{ii}ci{dd}cccc{ii}c{dd}cccci{ii}cd{dd}ccccii{ii}cdd{dd}ccccd{{{i}}}odsddddcccc{{{i}}}oddsddddcccci{ddd}soiii{ii}cccc{{d}}o{i}ci{d}oi{iii}ccc{ddd}o{iii}cccd{ii}ci{dd}ccc{ii}c{dd}ccci{ii}cd{dd}cccii{ii}cdd{dd}cccd{{{i}}}odsddddccc{{{i}}}oddsddddccci{ddd}soiii{ii}ccc{{d}}o{i}ci{d}oi{iii}cc{ddd}o{iii}ccd{ii}ci{dd}cc{ii}c{dd}cci{ii}cd{dd}ccii{ii}cdd{dd}ccd{{{i}}}odsddddcc{{{i}}}oddsddddcci{ddd}soiii{ii}cc{{d}}o{i}ci{d}oi{iii}c{ddd}o{iii}cd{ii}ci{dd}c{ii}c{dd}ci{ii}cd{dd}cii{ii}cdd{dd}cd{{{i}}}odsddddc{{{i}}}oddsddddci{ddd}soiii{ii}c{{d}}o{i}ciio{d}ioioioioioioioi{d}o{i}ci{d}oi{iii}c{ddd}o{iii}cd{ii}ci{dd}c{ii}c{dd}ci{ii}cd{dd}cii{ii}cdd{dd}cd{{{i}}}odsddddc{{{i}}}oddsddddci{ddd}soiii{ii}c{{d}}o{i}ci{d}oi{iii}cc{ddd}o{iii}ccd{ii}ci{dd}cc{ii}c{dd}cci{ii}cd{dd}ccii{ii}cdd{dd}ccd{{{i}}}odsddddcc{{{i}}}oddsddddcci{ddd}soiii{ii}cc{{d}}o{i}ci{d}oi{iii}ccc{ddd}o{iii}cccd{ii}ci{dd}ccc{ii}c{dd}ccci{ii}cd{dd}cccii{ii}cdd{dd}cccd{{{i}}}odsddddccc{{{i}}}oddsddddccci{ddd}soiii{ii}ccc{{d}}o{i}ci{d}oi{iii}cccc{ddd}o{iii}ccccd{ii}ci{dd}cccc{ii}c{dd}cccci{ii}cd{dd}ccccii{ii}cdd{dd}ccccd{{{i}}}odsddddcccc{{{i}}}oddsddddcccci{ddd}soiii{ii}cccc{{d}}o{i}ci{d}oi{iii}ccccc{ddd}o{iii}cccccd{ii}ci{dd}ccccc{ii}c{dd}ccccci{ii}cd{dd}cccccii{ii}cdd{dd}cccccd{{{i}}}odsddddccccc{{{i}}}oddsddddccccci{ddd}soiii{ii}ccccc{{d}}o{i}ci{d}oi{iii}cccccc{ddd}o{iii}ccccccd{ii}ci{dd}cccccc{ii}c{dd}cccccci{ii}cd{dd}ccccccii{ii}cdd{dd}ccccccd{{{i}}}odsddddcccccc{{{i}}}oddsddddcccccci{ddd}soiii{ii}cccccc{{d}}o{i}ci{d}oi{iii}ccccccc{ddd}o{iii}cccccccd{ii}ci{dd}ccccccc{ii}c{dd}ccccccci{ii}cd{dd}cccccccii{ii}cdd{dd}cccccccd{{{i}}}odsddddccccccc{{{i}}}oddsddddccccccci{ddd}soiii{ii}ccccccc{{d}}o{i}ci{d}oi{iii}cccccccc{ddd}o{iii}ccccccccd{ii}ci{dd}cccccccc{ii}c{dd}cccccccci{ii}cd{dd}ccccccccii{ii}cdd{dd}ccccccccd{{{i}}}odsddddcccccccc{{{i}}}oddsddddcccccccci{ddd}soiii{ii}cccccccc{{d}}o

Try it online!
Deadfish~ has two output commands, o to print the accumulator as an integer and c to print a character. All whitespace is printed with c, and 84 of the 190 digits are printed with c, determined by an exhaustive search. If you're interested, here is the semi-golfed and fully unreadable generator: Try it online!

Java (JDK), 105 103 bytes
a->{for(int j,i=-9;i++<8;){var s="";for(j=0;j++<9;)s+=j+" ".repeat(i<0?-i:i);System.out.println(s+0);}}

Try it online!
Thanks to ceilingcat for -2

Scala, 77 76 bytes
(for(i<- -8 to 8)yield"1234567890".mkString(" "*math.abs(i)))foreach println

Try it online
Thanks Kevin Cruijssen for 1 byte saved!

Nice answer, +1 from me. :) You can save 1 byte by removing the space at )foreach.

Vyxal Ṁjr, 10 bytes
₀ƛIkdǓj;Ṙ∞

Try it Online!
port of my vyxal 3 answer

Python, 84 bytes
for x in range(-8,9):
 z=""
 for y in range(1,11):z+=str(y%10)+" "*abs(x)
 print(z)

Try it online

Python 2, 72 bytes
for i in range(-8,9):print(('%-'+'%ds'%-~abs(i))*10)%tuple('1234567890')

Try it online!

Vim, 53 bytes
i1234567890^[^qq8a ^[lq8@qqeYpPqqqlxbequ^qw9@q@eq7@wdj

Where ^[ is the ESC Key.
i1234567890^[^       puts 1-9+0 in the buffer and returns the cursor to the beginning
qq8a ^[lq8@q         puts 8 spaces between each of the numbers
qeYpPq               records @e to duplicate the line twice and stay on the middle one
qqlxbequ^            records @q to delete one space between numbers and undoes it
qw9@q@eq             records @w to do @q 9 times, then @e
7@wdj                does @w 7 more times, then deletes two lines

Vyxal 3 j, 12 bytes
₀ƛkdṘmð×j]Ṛṅ

Try it Online!

authors: Евгений Новиков

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

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


text:
Quine over network
Write a program, that sends its own source code over network.
Network example is TCP/UDP or web socket. Ethernet, Bluetooth, Wi-Fi and internet over USB are allowed.
No need to write receiver program. You can use any encoding protocol, but decoder will be realizable.
Rules

Network is not a stdout, screen, USB, UART, GPIO or same.
The program must be at least 1 byte long.
No input or accessing source from file system.
No extra software to send stdout to network like ssh.
This is code-golf, shortest code wins.

Is there a specific host we need to send to?

@KevinCruijssen you can use any, but it will be able to recive message

Could you give a valid example-host?

@KevinCruijssen localhost

This seems like the kind of generalised quine where the quine part adds nothing to the networking part and the networking part adds nothing to the quine part.

does unclear means boring?

Java 8, 662 bytes
import java.io.*;import java.util.*;interface M{static void main(String[]a)throws Exception{String s="import java.io.*;import java.util.*;interface M{static void main(String[]a)throws Exception{String s=%c%s%1$c,x=s=s.format(s,34,s);for(List l=Arrays.asList(x.split(%1$c%1$c));!x.equals(s);s=s.join(%1$c%1$c,l));ObjectOutputStream o=new ObjectOutputStream(new java.net.Socket(%1$clocalhost%1$c,0).getOutputStream());o.writeObject(s);o.flush();}}",x=s=s.format(s,34,s);for(List l=Arrays.asList(x.split(""));!x.equals(s);s=s.join("",l));ObjectOutputStream o=new ObjectOutputStream(new java.net.Socket("localhost",0).getOutputStream());o.writeObject(s);o.flush();}}

Creating a quine in Java is verbose as F... >.>
Explanation:
'Try it' here. (Will result in java.net.SocketException: Permission denied.)
import java.io.*;              // Required import for ObjectOutputStream
import java.util.*;            // Required import for List and Arrays
interface M{                   // Class
  static void main(String[]a)  //  Required main-method
      throws Exception{        //  required throws for the Stream and Socket
    String s="import java.io.*;import java.util.*;interface M{static void main(String[]a)throws Exception{String s=%c%s%1$c,x=s=s.format(s,34,s);for(List l=Arrays.asList(x.split(%1$c%1$c));!x.equals(s);s=s.join(%1$c%1$c,l));ObjectOutputStream o=new ObjectOutputStream(new java.net.Socket(%1$clocalhost%1$c,0).getOutputStream());o.writeObject(s);o.flush();System.out.println(s);}}",
                               //   Quine-String
     x=s=s.format(s,34,s);for(List l=Arrays.asList(x.split(""));!x.equals(s);s=s.join("",l));
                               //   Quine-magic
    ObjectOutputStream o=new ObjectOutputStream(new java.net.Socket("localhost",0).getOutputStream());
                               //   Output stream to http://localhost:0000/
    o.writeObject(s);          //   Write to the output stream
    o.flush();                 //   And send it
  }                            //  End of main-method
}                              // End of class

The String s contains the unformatted source code.
%s is used to input this String into itself with the s.format(...).
%c, %1$c and the 34 are used to format the double-quotes.
s.format(s,34,s) puts it all together

Slightly modified with print to prove it's a quine:
Try it here.

Well is this considered as a quine? Sorry, I'm new to this. But you've just copypasted your code in a string you print afterwards >_< I was seeing quine as some complicated algorithm playing with generated bytecode. +1 though ^^'

@V.Courtois Thanks for the +1. :) Although most programming languages have a built-in for quines, Java does not. Pasting the entire code into a String and using x=s=s.format(s,34,s);for(List l=Arrays.asList(x.split(""));!x.equals(s);s=s.join("",l)); is a.f.a.i.k. one of the few ways to actually make a 'quine' in Java. Currently this is still acceptable as a quine, although it has been mentioned here in the "Eval quines" section of this Meta post, with the question if we should still allow this: We need a new proper quine definition. No conclusion of it yet.

Suggest ::1 instead of localhost

authors: Евгений Новиков