I am getting the value of date time
from server in a variable a1
:
let a1 = (new Date(estimatedServerTimeMs));
console.log of a1
Sun Apr 05 2020 11:36:56 GMT+0530 (India Standard Time)
I break it to a simple date format like this 5-3-2020
but i want it to be like 05-APR-2020
Below is my code:
let a1 = (new Date(estimatedServerTimeMs));
console.log(a1);
let show_year_month_date = a1.getDate()+'-'+ a1.getMonth() +'-'+ a1.getFullYear();
console.log(show_year_month_date);
How can I:
- change date to 2 digits
- change month from numeric to 3 character value