I have a dateTime stored in database using this line of code:
var now=DateTime.Now;
so after it stored, the data is like this in database and also after recalling the entity:
2019-01-26 17:27:46.297
when i try to convert it to another culture datetime using this method:
public static string ToPersianDate(this DateTime t)
{
var pc = new PersianCalendar();
return $"{pc.GetYear(t)}/{pc.GetMonth(t)}/{pc.GetDayOfMonth(t)}";
}
after using this method :
var persianDate=now.ToPersianDate();
I get this string as a result:
2019/01/26
But I expected to get this result:
1397/11/06