Skip to content Skip to sidebar Skip to footer

Convert Facebook Json Created_time Of String Format To Other Format

I'm developing a website and I'm trying to get created_time from Facebook's JSON. I was successful in that and I got it as 2018-04-17T17:25:23+0000. Now this should be converted in

Solution 1:

Try this

var date=newDate('2018-04-17T17:25:23+0000');
var day= date.getDate();
var month= date.getMonth() +1;
var year= date.getFullYear();
var new_format =month+'/'+day+'/'+year; // format :m/d/y

More information

Solution 2:

With your example date above, you can simply create a javascript date object like var date = new Date('2018-04-17T17:25:23+0000'); and use this for creating any specific date formats.

See How to get current formatted date dd/mm/yyyy in Javascript and append it to an input for creating a new format

Post a Comment for "Convert Facebook Json Created_time Of String Format To Other Format"