avatar
format javascript date object Javascript

> 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"' }


24
get unix timestamp javascript get current date javascript get current month javascript get current year javascript
You need to login to do this manipulation!