How to convert the string into month and year" example mfgdate is a string that value is "10/2014" how to convert ?
please help me..
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Dipankar BiswasRank #992 · 2K reputationPosted Apr 21, 2015, 2:23 AM EDT
See This link.. To help..https://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx
Venkat KumarRank #3,138 · 456 reputationPosted Apr 21, 2015, 2:40 AM EDT
DateTime d = Convert.ToDateTime("10/2014");
Response.Write(d.ToString("MMM/yyyy"));
Output : Oct/ 2014
aravinth kandasamy57 reputationPosted Apr 21, 2015, 2:45 AM EDT
Nanhe SiddiqueRank #1,103 · 1.7K reputationPosted Apr 21, 2015, 2:54 AM EDT
var dateVar = "2010-10-30"; var dsplit = dateVar.split("-"); var d=new Date(dsplit[0],dsplit[1]-1,dsplit[2]);aravinth kandasamy57 reputationPosted Apr 21, 2015, 2:56 AM EDT
Venkat KumarRank #3,138 · 456 reputationPosted Apr 21, 2015, 3:25 AM EDT
var arr = mmDDYYY.split("/");
return new Date(arr[2],arr[0]-1,arr[1]);
}
alert( toDate("07/31/2014") );
go through this link http://jsfiddle.net/oc45w9c3/
Don't forget to accept the answer if it matches your requirement.