0

我有一个数据库,其中有一个表名 student 和 4 列名称、家庭、日期出生在应用程序中我有 3 个文本框和数据 gridview 日期在日期时间“2013-05-01”的数据库中输入,但我不想显示在数据 gridview 中波斯日历

4

1 回答 1

1

您可以从using System.Globalization后面的代码中使用 from,如下所示:

public string Date(string yourDate)
{
    PersianCalendar pdate = new PersianCalendar();

    DateTime nT = new DateTime();

    nT = DateTime.Parse(yourDate);

    string s = String.Format("{0}/{1}/{2}", pdate.GetYear(nT), pdate.GetMonth(nT), pdate.GetDayOfMonth(nT));

    return s;
}
于 2013-10-31T16:55:43.613 回答