> Follow link to get standard language codes for each area or country. For example, look at Vietnamese is vi
exports.handler = async (event, context) => {
var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
var res = new Date().toLocaleDateString('vi', options);
const response = {
statusCode: 200,
body: JSON.stringify(res),
};
return response;
};
> Output (you can remove options if you want to get 18/12/2022)
node -r esbuild-register run.ts
{ statusCode: 200, body: '"Chủ Nhật, 18 tháng 12, 2022"' }