Recent versions of Node.js support the Intl.DateTimeFormat constructor for localising dates but the set of locales must be explicitly enabled.
We can now format dates in the desired locale format:
'use strict'; let date = new Date(); let dtf = new Intl.DateTimeFormat('it-IT'); console.log(dtf.format(date));
In a browser the output will be 6/2/2019 but in Node.js we'll see 2/6/2019, because of the default locale used by Node, which is en-US.
The Node documentation says that internationalisation features must be enabled either during compilation or with execution options.
In other words, if we don't do so, Node will fall back to its default locale which, as we said earlier, is en-US.