You need to sign in to do that
Don't have an account?

date format conversion
Hi,
I want to convert a datetime field to date field in javsscript
var date=record.LastModifiedDate;
what is the method i can use to convert it
i am currently using the below format
var date = new Date(record.LastModifiedDate);
console.log(date.toISOString().slice(0,10));
but its displaying in the below format which is wrong
Fri May 09 2014 10:30:50 GMT+0530 (India Standard Time)
i want it in below format
2014-05-09
Thanks
I want to convert a datetime field to date field in javsscript
var date=record.LastModifiedDate;
what is the method i can use to convert it
i am currently using the below format
var date = new Date(record.LastModifiedDate);
console.log(date.toISOString().slice(0,10));
but its displaying in the below format which is wrong
Fri May 09 2014 10:30:50 GMT+0530 (India Standard Time)
i want it in below format
2014-05-09
Thanks
Try this code:-
Thanks
Anurag Jain
You can try this also.