i have added 1 date field in web.confing profile area
now in home page i want to display in the format of fullmonth date, full year ex. february 20, 2010
so how to do that..?
i wrote like
ProfileCommon p;
protected void Page_Load(object sender, EventArgs e)
{
p = this.Profile;
lblbay.Text = p.BirthDate.ToShortDateString();
}
i tried to ToLongDateString() bt i getting date including the day :"Tuesday, January 01, 1980"
i want only "January 01, 1980"
any idea..?
thank your!!


Raaj KumarRank #7,836 · 233 reputationPosted Feb 20, 2010, 2:54 AM EST
Try this,
string date = String.Format("{0:MMMM d, yyyy}", p.BirthDate);
where p.BirthDate should be DateTime datatype.
Regards,
Raaj
Dipa AhujaRank #1,168 · 1.5K reputationPosted Feb 20, 2010, 4:54 AM EST