Wednesday 3 May 2017

How to convert isi date to iso in js

I am getting the date as

data.created = "Wed May 03 2017 15:41:49 GMT 0530(IST)"

I want to convert it to regular isi format like

 2017-03-12

My code,

 var created = new Date(data.created);
  created = created.toISOString() 

Can anyone help me.Thanks.



via MMR

No comments:

Post a Comment