Convert json string to date in dd-mm-yy format using javascript

hud

I want to bind data in a dd-mm-yy format for which I am using json to bind. Currently I get date as 2014-06-18T00:00:00

I want in dd-mm-yy format. Kindly let me know how to do that.

Below is my code for the same.

if (getJSONValue.LAUNCH_DATE != "" || getJSONValue.LAUNCH_DATE == null) {
            $('#txtLaunchDate').val(getJSONValue.LAUNCH_DATE);
        }

my getJSONValue.LAUNCH_DATE = 2014-06-18T00:00:00

sumit chauhan

see snippet

var newDate = new Date("2014-06-18T00:00:00");
var day = newDate.getDate();
var month = newDate.getUTCMonth() + 1;
var year = newDate.getFullYear();
console.log(day + "-" + ("0" + (month)) + "-" + year );

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Convert MySQL date format to DD/MM/YY date format using Javascript

How to convert the given date to dd-mm-yy format in javascript?

want to convert string mm/dd/yy to date yyyy/mm/dd format in Sybase

Javascript convert date format from "dd/mm/yy" to "mm/dd/yyyy"

convert TZ date format to "dd/mm/yy hh:mm:ss" in Javascript

Date format dd/mm/yy

How to convert date format "dd/mm/yy" to "yy/mm/dd" for mysql database inserting?

How to convert date dd/mm/YY to mm-dd-YY format in PHP

How To Convert String ' dd/mm/yy hh:MM:ss ' to Date in javascript?

The simplest way to convert a long date format to YY/MM/DD HTML

Convert string(Date(1646764200000+0530)) to date in the format(dd-mm-yyyy) using javascript

GoogleFinace convert dd/mm/yy to yy,mm,dd format

Regular expression convert Date format from dd-mon-yy to dd/MM/yy

JavaScript how to get tomorrows date in format dd-mm-yy

Check if input string contains date(specially in the format yy-mm-dd) using python

How to convert ISOString to date format dd/mm/yyyy using javascript

How to change/convert input date format from MM dd yy to yyyy-mm-dd on submit

Convert date with format dd.mm.yy to yyyy-mm-dd in python

Android - change Date Format to dd/mm/yy

SAS numeric date format to dd/mm/yy

Convert Timestamp string (dd MMM yyyy HH:mm:ss) to Date (DD/MM/YY) in Google Sheets

how to convert sql date formate unix time stamp to date format as dd mm yy format?

pyspark sql convert date format from mm/dd/yy hh:mm or yyyy-mm-dd hh:mm:ss into yyyy-mm-dd hh:mm format

How to convert String mm/dd/yyyy to Date mm/dd/yyyy using JavaScript?

Change string "dd/mm/yy HH:mm:ss" into accepted date/time format

Convert string timestamp mm/dd/yy hh:mm:ss to a date/time type in google sheets

How to convert a string in yyyy-mm-dd format to a Javascript Date Object without considering the date as UTC

How to convert string date (25.04.2016) to date format (mm/dd/yyyy)?

date format yyyy-mm-dd to dd-M-yy