js date locale code example
Example 1: toLocaleDateString() options
new Date("1983-March-25").toLocaleDateString('fr-CA', { year: 'numeric', month: '2-digit', day: '2-digit' })
'03/25/1983'
Example 2: js datetime local
var date = new Date();
var dd = String(date.getDate()).padStart(2, '0');
var mm = String(date.getMonth() + 1).padStart(2, '0');
var yyyy = date.getFullYear();
today = mm + '/' + dd + '/' + yyyy;
var time = date.toLocaleTimeString();
var dateTime = "Date: " + today + " and Time: " + time;