Skip to content
Advertisement

convert datetime to string using AJAX

Guys I would like to ask for your help I have here a Get Method using AJAX I successfully get the date from database this is the output 2020-08-13T00:00:00 however I wanted to convert the date format to this 2020-08-13 how can I convert the the datetime? below is my code

/Get/ $(document).ready(function () {

JavaScript

})

Thank you for your help

Advertisement

Answer

you can use this function

JavaScript

it should be this way

JavaScript

enter image description here

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement