Saturday, 21 October 2017

MVC - JavaScript - Convert Datetime to Date

Watch this example on YouTube


@section Scripts{
    <script type="text/javascript">
        $(document).ready(function () {
            var datetime = '2017-10-18 12:00 AM';
            alert("DateTime: " + datetime);
            var date = datetime.split(' ')[0];
            alert("Date: " + date);

No comments:

Post a Comment