I have a simple response ajax that contains a date value like this format : 2014-12-11T00:00:00
i just want to ask , how to format this date to Dec 11,2014
Thank you
$(row).find("#_TEST_DATE").text(obj.TEST_DATE);
Hi ruben,
Refer below sample code.
HTML
<script type="text/javascript"> window.onload = function () { alert(SetDateFromat('2014-12-11T00:00:00')); } function SetDateFromat(datetime) { var fullDate = new Date(datetime); var month = fullDate.toLocaleString('en-US', { month: 'short' }); var date = fullDate.getDate(); return month + " " + date + "," + fullDate.getFullYear(); } </script>
Demo
© COPYRIGHT 2024 ASPSnippets.com ALL RIGHTS RESERVED.