As a newcomer to UI coding, I am faced with the challenge of working with date data from JSON in the format "2021-02-28 00:00:00"
. However, when writing to an xlsx file, I need the date to be in a different format rather than as a string. Here is my attempted solution:
variable = new Date("2021-02-28 00:00:00")
This results in the date object appearing as follows:
Sun Feb 28 2021 00:00:00 GMT+0530 (India Standard Time)
But what I really want is the date to be displayed in the following format [still as a date object and not a string]:
28 Feb 2021 00:00:00